summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* i965/skl: Align compressed textures to four times the block sizeNeil Roberts2015-05-051-4/+27
| | | | | | | | | | | | On Skylake it is possible to choose your own alignment values for compressed textures but they are expressed as a multiple of the block size. The minimum alignment value we can use is 4 so we effectively have to align to 4 times the block size. This patch makes it initially set mt->align_[wh] to the large alignment value and then later divides it by the block size so that it can be uploaded as part of the surface state. Reviewed-by: Ben Widawsky <[email protected]>
* egl: image_dma_buf_export - use KHR 64-bit typeDave Airlie2015-05-053-3/+3
| | | | | | | | After talking to Jon Leech he suggested this should be fine. update spec to the version in the registry. Signed-off-by: Dave Airlie <[email protected]>
* glapi/es3.1: Add support for GLES versions > 3.0Ian Romanick2015-05-041-2/+2
| | | | | | | | | | | | Make the checks in the Python script and the generated code more generic to support arbitrary GLES versions >= 2.0. The updated dispatch_sanity.cpp test discovered this problem. Without this, the next patch would erroneously enable GLES 3.1 functions in GLES 2.0 and GLES 3.0. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl/es3.1: Allow misc ARB_gpu_shader5 built-ins in GLSL ES 3.10Ian Romanick2015-05-041-11/+11
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl/es3.1: Allow textureGather and textureGatherOffset in GLSL ES 3.10Ian Romanick2015-05-041-29/+61
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl/es3.1: Allow enhnaced packing functions in GLSL ES 3.10Ian Romanick2015-05-041-6/+7
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl/es3.1: Allow interger mix built-ins in GLSL ES 3.10Ian Romanick2015-05-045-7/+55
| | | | | | | | v2: Add missing lexer support. Noticed by Tapani. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> [v1]
* glsl/es3.1: Allow separate shader objects in GLSL ES 3.10Ian Romanick2015-05-041-2/+2
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl/es3.1: Allow explicit uniform locations in GLSL ES 3.10Ian Romanick2015-05-041-4/+13
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl/es3.1: Allow 3.10 ES shaders in a GLES 3.1 contextIan Romanick2015-05-042-3/+8
| | | | | | | | Currently no 3.10 ES features (beyond 3.00 ES) are enabled. That will come later. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Add _mesa_is_gles31 helperIan Romanick2015-05-041-1/+11
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl: Add glsl_parser_state::has_atomic_counters helperIan Romanick2015-05-045-5/+10
| | | | | | | v2: Change GL version from 400 to 420. Noticed by Tapani and Ilia. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Use bool in _mesa_is_ helpers instead of GLbooleanIan Romanick2015-05-041-4/+4
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Trivial coding standards cleanupsIan Romanick2015-05-041-15/+10
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Use bool instead of GLbooleanIan Romanick2015-05-041-158/+157
| | | | | | | | | | v2: Squash in whitespace fixes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* glsl: Silence unused parameter warningsIan Romanick2015-05-042-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I opted to comment out "last_field" because it was not obvious what the meaning of the dangling bool would be. For the other parameters, the meaning was more intuitive without the name. link_uniform_blocks.cpp:70:65: warning: unused parameter 'name' [-Wunused-parameter] virtual void enter_record(const glsl_type *type, const char *name, ^ link_uniform_blocks.cpp:77:65: warning: unused parameter 'name' [-Wunused-parameter] virtual void leave_record(const glsl_type *type, const char *name, ^ link_uniform_blocks.cpp:93:62: warning: unused parameter 'record_type' [-Wunused-parameter] bool row_major, const glsl_type *record_type, ^ link_uniform_blocks.cpp:94:34: warning: unused parameter 'last_field' [-Wunused-parameter] bool last_field) ^ link_uniforms.cpp:547:65: warning: unused parameter 'name' [-Wunused-parameter] virtual void enter_record(const glsl_type *type, const char *name, ^ link_uniforms.cpp:556:65: warning: unused parameter 'name' [-Wunused-parameter] virtual void leave_record(const glsl_type *type, const char *name, ^ link_uniforms.cpp:567:34: warning: unused parameter 'last_field' [-Wunused-parameter] bool last_field) ^ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Restore functionality to dispatch sanity testIan Romanick2015-05-041-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Along with a couple secondary goals, the dispatch sanity test had two major, primary goals. 1. Ensure that all functions part of an API version are set in the dispatch table. 2. Ensure that functions that cannot be part of an API version are not set in the dispatch table. Commit 4bdbb58 removed the tests ability to fulfill either of its primary goals by removing anything that used _mesa_generic_nop(). It seems like the problem on Windows could have been resolved by adding the NULL context pointer check from nop_handler to _mesa_generic_nop(). There is, however, some debugging benefit to actually getting the (supposed) function name logged in the "unsupported function called" message. The preceding commit added a function, _glapi_new_nop_table, that allocates a table of per-entry point no-op functions. Restore the ability to actually validate the sanity of the dispatch table by using _glapi_new_nop_table. Previous to this commit removing a function from one of the *_functions_possible lists would not cause the test to fail. With this commit removing such a function will result in failure, as is expected. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965: Fix variable indexing of sampler arrays under non-uniform control flow.Francisco Jerez2015-05-043-6/+8
| | | | | | | | | | | | | | | | | | ARB_gpu_shader5 requires sampler array indexing expressions to be dynamically uniform, this however doesn't have any implications on the control flow that leads to the evaluation of that expression being uniform. Use emit_uniformize() to obtain an arbitrary live value from the binding table index calculation instead of assuming that the first channel is always live. Fixes the following Piglit test cases: arb_gpu_shader5/execution/sampler_array_indexing/fs-nonuniform-control-flow.shader_test arb_gpu_shader5/execution/sampler_array_indexing/vs-nonuniform-control-flow.shader_test part of the series: http://lists.freedesktop.org/archives/piglit/2015-February/014615.html Reviewed-by: Matt Turner <[email protected]>
* i965: Fix variable indexing of UBO arrays under non-uniform control flow.Francisco Jerez2015-05-043-10/+11
| | | | | | | | | | | | | | | | | | ARB_gpu_shader5 requires UBO array indexing expressions to be dynamically uniform, this however doesn't have any implications on the control flow that leads to the evaluation of that expression being uniform. Use emit_uniformize() to obtain an arbitrary live value from the binding table index calculation instead of assuming that the first channel is always live. Fixes the following Piglit tests: arb_gpu_shader5/execution/ubo_array_indexing/fs-nonuniform-control-flow.shader_test arb_gpu_shader5/execution/ubo_array_indexing/vs-nonuniform-control-flow.shader_test part of the series: http://lists.freedesktop.org/archives/piglit/2015-February/014616.html Reviewed-by: Matt Turner <[email protected]>
* i965: Define helper function to copy an arbitrary live component from some ↵Francisco Jerez2015-05-044-0/+28
| | | | | | register. Reviewed-by: Matt Turner <[email protected]>
* i965: Perform basic optimizations on the FIND_LIVE_CHANNEL opcode.Francisco Jerez2015-05-046-0/+93
| | | | | | | | v2: Save some CPU cycles by doing 'return progress' rather than 'depth++' in the discard jump special case. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Introduce the FIND_LIVE_CHANNEL pseudo-opcode.Francisco Jerez2015-05-046-0/+94
| | | | | | | | | | | | | This instruction calculates the index of an arbitrary channel enabled in the current execution mask. It's expected to be used as input for the BROADCAST opcode, but it's implemented as a separate instruction rather than being baked into BROADCAST because FIND_LIVE_CHANNEL has no dependencies so it can always be CSE'ed with other instances of the same instruction within a basic block. v2: Whitespace fixes. Reviewed-by: Matt Turner <[email protected]>
* i965: Perform basic optimizations on the BROADCAST opcode.Francisco Jerez2015-05-048-0/+44
| | | | | | v2: Style fixes. Reviewed-by: Matt Turner <[email protected]>
* i965: Introduce the BROADCAST pseudo-opcode.Francisco Jerez2015-05-046-0/+98
| | | | | | | | | | | | | | | | | | | The BROADCAST instruction picks the channel from its first source given by an index passed in as second source. This will be used in situations where all channels from the same SIMD thread have to agree on the value of something, e.g. a surface binding table index. This is in particular the case for UBO, sampler and image arrays, which can be indexed dynamically with the restriction that all active SIMD channels access the same index, provided to the shared unit as part of a single scalar field of the message descriptor. Simply taking the index value from the first channel as we were doing until now is incorrect, because it might contain an uninitialized value if the channel had previously been disabled by non-uniform control flow. v2: Minor style fixes. Improve commit message. Reviewed-by: Matt Turner <[email protected]>
* glsl: Keep track of the early_fragment_tests flag in gl_shader.Francisco Jerez2015-05-045-3/+13
| | | | | | | | And rename _mesa_glsl_parse_state::early_fragment_tests to fs_early_fragment_tests for consistency with other FS-specific flags in the same struct. Reviewed-by: Matt Turner <[email protected]>
* glsl: Error out on invalid uses of the early_fragment_tests layout qualifier.Francisco Jerez2015-05-043-5/+34
| | | | Reviewed-by: Matt Turner <[email protected]>
* glsl: Forbid use of image qualifiers in declarations of type other than image.Francisco Jerez2015-05-041-2/+9
| | | | Reviewed-by: Matt Turner <[email protected]>
* glsl: Split off memory qualifiers from storage qualifiers.Francisco Jerez2015-05-041-1/+16
| | | | | | | | Image memory qualifiers (coherent, volatile, restrict, readonly and writeonly) follow slightly different rules from storage qualifiers, e.g. the uniqueness rule doesn't apply. Make them a separate non-terminal. Reviewed-by: Matt Turner <[email protected]>
* glsl: Forbid opaque variables as operands of the ternary operator.Francisco Jerez2015-05-041-0/+12
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: Update image unit state when glBindImageTexture is called with texture=0.Francisco Jerez2015-05-041-16/+15
| | | | | | | | | | There's no indication in the spec that the image unit state other than the bound texture object shouldn't be updated when glBindImageTexture() is called passing the zero texture as argument. It's very unlikely that any application would ever have relied on this, but it's easy to get right, and it fixes the "state" ARB_shader_image_load_store piglit test. Reviewed-by: Matt Turner <[email protected]>
* mesa: Initialize image units to default state on context creation.Francisco Jerez2015-05-043-0/+21
| | | | | | | This is the required initial image unit state according to "Table 23.45. Image State (state per image unit)" of the OpenGL 4.3 specification. Reviewed-by: Matt Turner <[email protected]>
* mesa: Implement image uniform queries.Francisco Jerez2015-05-041-1/+3
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: Validate original image internal format rather than derived mesa format.Francisco Jerez2015-05-041-3/+3
| | | | | | | | | | | This matches what _mesa_BindImageTextures() does. The derived image format (gl_texture_image::TexFormat) isn't necessarily equivalent to the internal format of the texture image. If a forbidden internal format has been specified we need to mark the image unit as invalid as required by the spec, regardless of the derived format. Fixes the "invalid" ARB_shader_image_load_store piglit test. Reviewed-by: Matt Turner <[email protected]>
* mesa: Call _mesa_test_texobj_completeness() before using _MaxLevel in image ↵Francisco Jerez2015-05-041-3/+4
| | | | | | | | | | validation. gl_texture_object::_MaxLevel doesn't have any meaningful value until _mesa_test_texobj_completeness() has been run. Fixes the "level" ARB_shader_image_load_store piglit test. Reviewed-by: Matt Turner <[email protected]>
* mesa: Add support for binding a buffer texture to a shader image unit.Francisco Jerez2015-05-041-31/+42
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: Add extern "C" guards to shaderimage.h to allow inclusion from C++ code.Francisco Jerez2015-05-041-0/+8
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: Export shader image format to mesa format conversion function.Francisco Jerez2015-05-042-5/+12
| | | | | | | This function will be useful for back-ends to translate an image internal format as specified in GLSL code into a mesa format. Reviewed-by: Matt Turner <[email protected]>
* swrast: Fix rgba_draw_pixels with GL_COLOR_INDEXIago Toral Quiroga2015-05-041-3/+26
| | | | | | | | | | | | | | When we implemented the format conversion rewrite we forgot to handle GL_COLOR_INDEX here, which needs special handling. Fixes the following piglit test: bin/gl-1.0-drawpixels-color-index -auto -fbo Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90213 Tested-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Add memory fence opcode.Francisco Jerez2015-05-046-0/+87
| | | | | Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Add typed surface access opcodes.Francisco Jerez2015-05-049-0/+261
| | | | | Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Add untyped surface write opcode.Francisco Jerez2015-05-049-0/+81
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Reorder sources of the untyped atomic opcode.Francisco Jerez2015-05-044-6/+6
| | | | | | | | | | | | This is consistent with the untyped surface read opcode. From now on all typed and untyped surface access opcodes will follow the same pattern: src[0] will be the message payload, src[1] will be the surface index and src[2] will be a control immediate (atomic operation for atomic opcodes and number of vector components for surface read and write opcodes). Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Pass the number of components as a source of the untyped surface read ↵Francisco Jerez2015-05-044-6/+10
| | | | | | | opcode. Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965/vec4: Add support for untyped surface message sends from GRF.Francisco Jerez2015-05-043-16/+14
| | | | | | | | | This doesn't actually enable untyped surface message sends from GRF yet, the upcoming atomic counter and image intrinsic lowering code will. Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Don't request untyped atomic writeback message if the destination is null.Francisco Jerez2015-05-042-2/+3
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Simplify generator code for untyped surface messages.Francisco Jerez2015-05-044-87/+18
| | | | | | | | | The generate_untyped_*() methods do nothing useful other than calling the corresponding function from brw_eu_emit.c. The calls to brw_mark_surface_used() will go away too in a future commit. Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Fix the untyped surface opcodes to deal with indirect surface access.Francisco Jerez2015-05-044-82/+99
| | | | | | | | | | | | Change brw_untyped_atomic() and brw_untyped_surface_read() to take the surface index as a register instead of a constant and to use brw_send_indirect_message() to emit the indirect variant of send with a dynamically calculated message descriptor. This will be required to support variable indexing of image arrays for ARB_shader_image_load_store. Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* ilo: use ilo_image exclusively in coreChia-I Wu2015-05-024-139/+149
| | | | | Initialize ilo_view_surface and ilo_zs_surface from ilo_image instead of ilo_texture.
* ilo: add ilo_image_can_enable_aux()Chia-I Wu2015-05-029-50/+27
| | | | It replaces ilo_texture_can_enable_hiz().
* ilo: make ilo_image more self-containedChia-I Wu2015-05-022-9/+21
| | | | Add depth0, sample_count, and scanout to ilo_image.