summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* nir/spirv: Give both block and buffer_block types an interface typeJason Ekstrand2015-11-071-1/+1
|
* nir/spirv: Increment num_ubos/ssbos when creating variablesJason Ekstrand2015-11-061-0/+3
|
* nir/spirv: Add a helper for determining if a block is externally visableJason Ekstrand2015-11-061-2/+11
|
* Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2015-11-0320-247/+493
|\
| * glsl: join calculate_array_size() and calculate_array_stride()Juha-Pekka Heikkila2015-11-021-110/+80
| | | | | | | | | | | | | | | | | | | | | | | | These helpers are ran for same case the same loop. Here joined their operation so the loop is ran just once. Also fixed out-of-memory condition here. v2: Make the loop simpler to read as per Tapani's suggestion Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Tested-by: Tapani Pälli <[email protected]>
| * glsl: OpenGLES GLSL 3.1 precision qualifiers ordering rulesJordan Justen2015-10-311-2/+4
| | | | | | | | | | | | | | | | | | The OpenGLES GLSL 3.1 specification uses the precision qualifier ordering rules from ARB_shading_language_420pack. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]>
| * glsl: Add compute shader builtin variables for OpenGLES 3.1Jordan Justen2015-10-311-1/+1
| | | | | | | | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]>
| * glsl: set image access qualifiers for AoATimothy Arceri2015-10-311-28/+49
| | | | | | | | Reviewed-by: Francisco Jerez <[email protected]>
| * nir: add shader_clock intrinsicEmil Velikov2015-10-302-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | v2: Add flags and inline comment/description. v3: None of the input/outputs are variables v4: Drop clockARB reference, relate code motion barrier comment wrt intrinsic flag. v5: Drop the "thus we can eliminate..." comment (Connor) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Matt Turner <[email protected]>
| * glsl: add support for the clock2x32ARB functionEmil Velikov2015-10-301-0/+43
| | | | | | | | | | | | | | v2: correctly set the return type Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
| * glsl: add ARB_shader_clock infrastructureEmil Velikov2015-10-303-0/+6
| | | | | | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
| * glsl: add fragdata arrays to program resource listTapani Pälli2015-10-291-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure that user is still able to query properties about variables that have gotten removed by opt_dead_builtin_varyings pass. Fixes following OpenGL ES 3.1 test: ES31-CTS.program_interface_query.output-layout No Piglit regressions. v2: cleanup, drop extra parenthesis (Topi) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]>
| * mesa: add fragdata_arrays list to gl_shaderTapani Pälli2015-10-291-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | This is required to store information about fragdata arrays, currently these variables get lost and cannot be retrieved later in sensible way for program interface queries. List will be utilized by next patch. Patch also modifies opt_dead_builtin_varyings pass to build list when lowering fragdata arrays. This is identical approach as taken with packed varyings pass. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]>
| * glsl: fix GL_BUFFER_DATA_SIZE value for shader storage blocks with unsize arraysSamuel Iglesias Gonsalvez2015-10-291-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From ARB_program_interface_query: "For the property of BUFFER_DATA_SIZE, then the implementation-dependent minimum total buffer object size, in basic machine units, required to hold all active variables associated with an active uniform block, shader storage block, or atomic counter buffer is written to <params>. If the final member of an active shader storage block is array with no declared size, the minimum buffer size is computed assuming the array was declared as an array with one element." Fixes the following dEQP-GLES31 tests: dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.named_block dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.unnamed_block dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.block_array v2: - Fix comment's indentation and explain that the parser already checked that unsized array is in last element of a shader storage block (Iago). - Add assert (Iago). Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
| * glsl: Mark gl_ViewportIndex and gl_Layer varyings as flat.Kenneth Graunke2015-10-281-12/+25
| | | | | | | | | | | | | | | | | | Integer varyings need to be flat qualified - all others were already. I think we just missed this. Presumably some hardware passes this via sideband and ignores attribute interpolation, so no one has noticed. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
| * nir: Copy "patch" flag from ir_variable to nir_variable.Kenneth Graunke2015-10-283-2/+5
| | | | | | | | | | | | | | This was introduced in GLSL IR after NIR development had branched. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
| * nir: Add intrinsics for tessellation shader system values.Kenneth Graunke2015-10-282-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nir_intrinsic_load_patch_vertices_in corresponds to gl_PatchVerticesIn, a special input in both the TCS and TES stages. nir_intrinsic_load_tess_coord corresponds to gl_TessCoord, a special tessellation evaluation shader input. nir_intrinsic_load_tess_level_outer/inner correspond to the gl_TessLevelOuter[] and gl_TessLevelInner[] evaluation shader inputs, which we treat as system values because they're stored specially. (These intrinsics are only for the TES - the TCS uses output variables.) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
| * glsl: Convert TES gl_PatchVerticesIn into a constant when using a TCS.Kenneth Graunke2015-10-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | When a TCS is present, the TES input gl_PatchVerticesIn is actually a constant - it's simply the # of output vertices specified by the TCS layout qualifiers. So, we can replace the system value with a constant, which may allow further optimization, and will likely be more efficient. If the TCS is absent, we can't do this optimization. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
| * glsl: keep track of intra-stage indices for atomicsTimothy Arceri2015-10-274-12/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is more optimal as it means we no longer have to upload the same set of ABO surfaces to all stages in the program. This also fixes a bug where since commit c0cd5b var->data.binding was being used as a replacement for atomic buffer index, but they don't have to be the same value they just happened to end up the same when binding is 0. Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Cc: Ilia Mirkin <[email protected]> Cc: Alejandro Piñeiro <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90175
| * nir: Add opcodes for saturated vector math.Eric Anholt2015-10-232-0/+51
| | | | | | | | | | | | | | | | | | This corresponds to instructions used on vc4 for its blending inside of shaders. I've seen these opcodes on other architectures before, but I think it's the first time these are needed in Mesa. v2: Rename to 'u' instead of 'i', since they're all 'u'norm (from review by jekstrand)
| * glsl: fix shader storage block member rules when adding program resourcesSamuel Iglesias Gonsalvez2015-10-231-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f24e5e did not take into account arrays of named shader storage blocks. Fixes 20 dEQP-GLES31.functional.ssbo.* tests: dEQP-GLES31.functional.ssbo.layout.single_struct_array.per_block_buffer.shared_instance_array dEQP-GLES31.functional.ssbo.layout.single_struct_array.per_block_buffer.packed_instance_array dEQP-GLES31.functional.ssbo.layout.single_struct_array.per_block_buffer.std140_instance_array dEQP-GLES31.functional.ssbo.layout.single_struct_array.per_block_buffer.std430_instance_array dEQP-GLES31.functional.ssbo.layout.single_struct_array.single_buffer.shared_instance_array dEQP-GLES31.functional.ssbo.layout.single_struct_array.single_buffer.packed_instance_array dEQP-GLES31.functional.ssbo.layout.single_struct_array.single_buffer.std140_instance_array dEQP-GLES31.functional.ssbo.layout.single_struct_array.single_buffer.std430_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.per_block_buffer.shared_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.per_block_buffer.packed_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.per_block_buffer.std140_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.per_block_buffer.std430_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.single_buffer.shared_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.single_buffer.packed_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.single_buffer.std140_instance_array dEQP-GLES31.functional.ssbo.layout.single_nested_struct_array.single_buffer.std430_instance_array dEQP-GLES31.functional.ssbo.layout.random.all_per_block_buffers.2 dEQP-GLES31.functional.ssbo.layout.random.all_per_block_buffers.29 dEQP-GLES31.functional.ssbo.layout.random.all_per_block_buffers.33 dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.3 V2: - Rename some variables (Timothy) Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
| * glsl: remove excess location qualifier validationTimothy Arceri2015-10-231-48/+22
| | | | | | | | | | | | | | | | | | Location has never been able to be a negative value because it has always been validated in the parser. Also the linker doesn't check for negatives like the comment claims. Reviewed-by: Tapani Pälli <[email protected]>
* | nir: remove sampler_set from nir_tex_instrJason Ekstrand2015-11-031-3/+0
| | | | | | | | | | Now that descriptor sets are handled in a lowering pass, this is no longer needed.
* | nir/spirv: Add support for push constantsJason Ekstrand2015-10-291-7/+104
| |
* | nir/intrinsics: Add a load_push_constant intrinsicJason Ekstrand2015-10-291-0/+1
| |
* | nir/spirv: Rework the way we handle interface typesJason Ekstrand2015-10-291-20/+18
| |
* | Revert "nir/intrinsic: Allow up to four indices"Jason Ekstrand2015-10-271-1/+1
| | | | | | | | | | | | This reverts commit 5eccd0b4b947d806c0725899a827e622e605f2cc. This was only needed for the store_ssbo_vk_indirect intrinsic
* | Revert "nir/intrinsics: Add new Vulkan load/store intrinsics"Jason Ekstrand2015-10-271-7/+2
| | | | | | | | | | | | | | This reverts commit 24bcc89c8fa326b838e9fea002065a40d4d04314. Now that we have the new vulkan_resource_index intrinsic, these variants of the classic UBO/SSBO instrinsics aren't needed.
* | nir/spirv: Use the new vulkan_resource_index intrinsicJason Ekstrand2015-10-271-11/+34
| | | | | | | | This is instead of using the _vk versions of UBO/SSBO load/store intrinsics
* | nir: Add a vulkan_resource_index intrinsicJason Ekstrand2015-10-271-0/+19
| |
* | nir/spirv: Add support for builtins in arraysJason Ekstrand2015-10-221-2/+31
| |
* | nir/spirv: Make the builtins array distinguish between in and outJason Ekstrand2015-10-222-4/+17
| |
* | nir/spirv: Make vtn_get_builtin_location smarterJason Ekstrand2015-10-221-20/+48
| | | | | | | | | | | | | | | | Instead of just stomping on the mode, it now validates asserts that the previously set mode is correct and only changes it if needed. We need to do this because, in geometry shaders, there are some builtins that can be either an input or an output depending on context. We can get that information from the SPIR-V source but we can't throw it away.
* | nir/spirv: Make get_builtin_variable take a nir_variable_modeJason Ekstrand2015-10-221-2/+4
| | | | | | | | | | We'll want this in a moment for validation but, for now, it just gets stompped by get_builtin_variable.
* | nir/spirv: Remove the vtn_type argument from _vtn_variable_load/storeJason Ekstrand2015-10-221-18/+10
| | | | | | | | | | Now that builtins are handled in deref chains, we don't really need this anymore.
* | nir/validate: Add better validation of load/store typesJason Ekstrand2015-10-221-2/+14
| |
* | nir/spirv: Add defaults for GS input/output primitive typesJason Ekstrand2015-10-211-0/+6
| | | | | | | | | | | | | | These are supposed to be specified in the SPIR-V source as SpvExecutionMode enums but glslang isn't giving them to us. A bug has been filed: https://github.com/KhronosGroup/glslang/issues/84
* | nir/spirv: Add capabilities and decorations for basic geometry shadersJason Ekstrand2015-10-211-6/+15
| |
* | nir/spirv: Add support for more CS system valuesJason Ekstrand2015-10-211-6/+12
| |
* | nir/spirv: Add support for various barrier type instructionsJason Ekstrand2015-10-211-0/+40
| |
* | Fix a couple of dereferencesJason Ekstrand2015-10-211-2/+2
| |
* | spirv/nir: Add more stage assertsJason Ekstrand2015-10-211-0/+5
| |
* | nir/spirv: Add support for GS metadataJason Ekstrand2015-10-211-3/+66
| |
* | nir/gather_info: Add more info for geometry shadersJason Ekstrand2015-10-211-0/+7
| |
* | Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2015-10-2112-104/+156
|\|
| * nir: Constify nir_gs_count_verticesJason Ekstrand2015-10-212-2/+2
| | | | | | | | Reviewed-by: Kenneth Graunke <[email protected]>
| * nir/info: Add more information about geometry shadersJason Ekstrand2015-10-212-0/+16
| | | | | | | | Reviewed-by: Kenneth Graunke <[email protected]>
| * glsl: check for arrays of arrays when assigning explicit locationsTimothy Arceri2015-10-211-1/+2
| | | | | | | | | | | | | | | | This fixes assigning explicit locations in the CTS test: ES31-CTS.explicit_uniform_location.uniform-loc-arrays-of-arrays Reviewed-by: Tapani Pälli <[email protected]>
| * glsl: add is_array_of_arrays() helperTimothy Arceri2015-10-211-0/+5
| | | | | | | | | | | | As suggested by Ian Romanick Reviewed-by: Tapani Pälli <[email protected]>
| * glsl: Fix bad indentation in bit_logic_result_type().Kenneth Graunke2015-10-201-47/+47
| | | | | | | | | | | | | | | | The first level of indentation was using 4 spaces. Mesa uses 3. Trivial. Signed-off-by: Kenneth Graunke <[email protected]>