summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glsl: add support for initialising sampler AoATimothy Arceri2015-10-151-34/+49
| | | | Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add support for linking uniform arrays of arraysTimothy Arceri2015-10-152-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | V3: Fix setting of data.location for struct AoA UBO members V2: Handle arrays of arrays in the same way structures are handled The ARB_arrays_of_arrays spec doesn't give very many details on how AoA uniforms are intended to be implemented. However in the ARB_program_interface_query spec there are details that show AoA are intended to be handled in a similar way to structs. Issues 7 from the ARB_program_interface_query spec: We define rules consistent with our enumeration rules for other complex types. For existing one-dimensional arrays, we enumerate a single entry if the array is an array of basic types, or separate entries for each array element if the array is an array of structures. We follow similar rules here. For a uniform array such as: uniform vec4 a[5][4][3]; we enumerate twenty different entries ("a[0][0][0]" through "a[4][3][0]"), each of which is treated as an array with three elements. This is morally equivalent to what you'd get if you worked around the limitation in current GLSL via: struct ArrayBottom { vec4 c[3]; }; struct ArrayMid { ArrayBottom b[3]; }; uniform ArrayMid a[5]; which would enumerate "a[0].b[0].c[0]" through "a[4].b[3].c[0]". Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Don't hardcode FS in "validation failed!" message.Kenneth Graunke2015-10-141-1/+1
| | | | | | | | Instead, print "Scalar VS" or "Scalar FS". Otherwise it's really confusing which stage is broken. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* glsl: Support uint index in lower_vector_insertJordan Justen2015-10-141-1/+5
| | | | | | | | | The ES31-CTS.compute_shader.pipeline-compute-chain test case generates an unsigned index by using gl_LocalInvocationID.x and gl_LocalInvocationID.y as array indices. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl: Support uint index in do_vec_index_to_cond_assignJordan Justen2015-10-141-1/+3
| | | | | | | | | The ES31-CTS.compute_shader.pipeline-compute-chain test case generates an unsigned index by using gl_LocalInvocationID.x and gl_LocalInvocationID.y as array indices. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* i965/fs: Ignore compute shaders in brw_nir_lower_inputsJordan Justen2015-10-141-0/+4
| | | | | | | | | | | | | | | The commit shown below caused compute shaders to hit the unreachable in the default of the switch block. Since compute shaders don't have any inputs, we can make brw_nir_lower_inputs a no-op for CS. commit 2953c3d76178d7589947e6ea1dbd902b7b02b3d4 Author: Kenneth Graunke <[email protected]> Date: Fri Aug 14 15:15:11 2015 -0700 i965/vs: Map scalar VS input locations properly; avoid tons of MOVs. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Simplify FS in brw_nir_lower_inputs to only support scalar modeJordan Justen2015-10-141-1/+2
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove unused functions in program.cBrian Paul2015-10-141-51/+0
| | | | | | replace_registers() and adjust_param_indexes() were unused. Reviewed-by: Matt Turner <[email protected]>
* mesa: minor indentation fix in _mesa_BindTextureUnit()Brian Paul2015-10-141-1/+1
|
* mesa: remove unused texUnit local in _mesa_BindTextureUnit()Brian Paul2015-10-141-7/+0
| | | | | | | The texture unit is error-checked before this and the texUnit var is unused, so remove it. Reviewed-by: Anuj Phogat <[email protected]>
* st/fbo: use pipe_surface_release instead of pipe_surface_referenceKrzysztof Sobiecki2015-10-141-1/+1
| | | | | | | | | | | pipe_surface_reference have problems with deleted contexts, so use of pipe_surface_release might be more appropriate. Fixes Wasteland 2 Director's Cut crash on start. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* glsl: Enable split of lower UBOs and SSBO also for compute shadersMarta Lofstedt2015-10-141-1/+1
| | | | | | | | | | | | | The split of Uniform blocks and shader storage block only loops up to MESA_SHADER_FRAGMENT and igonres compute shaders. This cause segfault when running the OpenGL ES 3.1 CTS tests with GL_ARB_compute_shader enabled. V2: Changed to use MESA_SHADER_STAGES instead of MESA_SHADER_COMPUTE Reviewed-by: Francisco Jerez <[email protected]> Signed-off-by: Marta Lofstedt <[email protected]>
* glsl: Include util/strndup.h.Jose Fonseca2015-10-141-0/+1
| | | | | | Fixes Windows builds. Trivial.
* glsl: calculate TOP_LEVEL_ARRAY_SIZE and STRIDE when adding resourcesTapani Pälli2015-10-142-242/+243
| | | | | | | | | | Patch moves existing calculation code from shader_query.cpp to happen during program resource list creation. No Piglit or CTS regressions were observed during testing. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* glsl: add top level array size and stride to gl_uniform_storageTapani Pälli2015-10-141-10/+22
| | | | | | | | | | | | Patch adds 2 new fields to gl_uniform_storage so that we don't need to calculate these values during runtime shader queries. This is required by upcoming changes to free GLSL IR after linking. Patch moves 3 booleans inside structure so that structure size stays the same after this change. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* i965: Adapt SSBOs to work with their own separate index spaceIago Toral Quiroga2015-10-145-69/+71
| | | | Reviewed-by: Kristian Høgsberg <[email protected]>
* glsl/lower_ubo_reference: lower UBOs and SSBOs to separate index spacesIago Toral Quiroga2015-10-141-8/+14
| | | | Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: Add {Num}UniformBlocks and {Num}ShaderStorageBlocks to gl_shader{_program}Iago Toral Quiroga2015-10-143-1/+118
| | | | | | These arrays provide backends with separate index spaces for UBOS and SSBOs. Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: Rename {Num}UniformBlocks to {Num}BufferInterfaceBlocksIago Toral Quiroga2015-10-1415-68/+68
| | | | | | | | | | | | | | Currently, these arrays in gl_shader and gl_shader_program hold both UBOs and SSBOs, so this looks like a better name. We were already using NumBufferInterfaceBlocks in gl_shader_program, so this makes things more consistent as well. In a later patch we will add {Num}UniformBlocks and {Num}ShaderStorageBlocks which will contain only references to UBOs and SSBOs respectively that will provide backends with a separate index space for both types of objects. Reviewed-by: Kristian Høgsberg <[email protected]>
* glsl: Fix variable_referenced() for vector_{extract,insert} expressionsIago Toral Quiroga2015-10-142-0/+18
| | | | | | | | | | | | | | We get these when we operate on vector variables with array accessors (i.e. things like a[0] where 'a' is a vec4). When we call variable_referenced() on these expressions we want to return a reference to 'a' instead of NULL. This fixes a problem where we pass a[0] as the first argument to an atomic SSBO function that expects a buffer variable. In order to check this, we use variable_referenced(), but that is currently returning NULL in this case, since the underlying rvalue is a vector_extract expression. Tested-by: Markus Wick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* nir: split SSBO min/max atomic instrinsics into signed/unsigned versionsIago Toral Quiroga2015-10-144-27/+43
| | | | | | | | | | | | | NIR is typeless so this is the only way to keep track of the type to select the proper atomic to use. v2: - Use imin,imax,umin,umax for the intrinsic names (Connor Abbott) - Change message for unreachable paths (Michael Schellenberger) Tested-by: Markus Wick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: fix indentation in vec4_visitor::calculate_live_intervalsIago Toral Quiroga2015-10-141-8/+8
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* i965/fs: Fix indentation in fs_live_variables::compute_start_endIago Toral Quiroga2015-10-141-9/+8
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* mesa: clean up comments for gl_current_attrib structBrian Paul2015-10-131-7/+5
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: make void vbo_exec_BeginVertices() staticBrian Paul2015-10-132-21/+20
| | | | | | Not called from any other file. Rename and move before use. Reviewed-by: Marek Olšák <[email protected]>
* vbo: document vbo_exec_context fieldsBrian Paul2015-10-131-7/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: minor clean-ups for vbo_exec_fixup_vertex()Brian Paul2015-10-131-2/+5
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: add assertion in ATTR_UNION macroBrian Paul2015-10-131-0/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: add comments, braces in ATTR_UNION() in vbo_exec_api.cBrian Paul2015-10-131-2/+12
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: fix whitespace in vbo_exec_draw.cBrian Paul2015-10-131-13/+12
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: move 'tmp' var initializationBrian Paul2015-10-131-1/+2
| | | | | | Improve readability a bit. Reviewed-by: Marek Olšák <[email protected]>
* vbo: improve fprintf() formattingBrian Paul2015-10-131-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: simplify vertex array initializations in vbo_context.cBrian Paul2015-10-131-52/+43
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: get rid of needless NR_MAT_ATTRIBS constantBrian Paul2015-10-131-6/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo: fix incorrect switch statement in init_mat_currval()Brian Paul2015-10-131-1/+1
| | | | | | | | | | | | The variable 'i' is a value in [0, MAT_ATTRIB_MAX-1] so subtracting VERT_ATTRIB_GENERIC0 gave a bogus value and we executed the default switch clause for all loop iterations. This doesn't fix any known issues but was clearly incorrect. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* mesa: pass caller name to create_textures()Brian Paul2015-10-131-7/+6
| | | | Simpler than the dsa flag approach.
* glsl: fix matrix stride calculation for std430's row_major matrices with two ↵Samuel Iglesias Gonsalvez2015-10-131-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | columns This is the result of applying several rules: From OpenGL 4.3 spec, section 7.6.2.2 "Standard Uniform Block Layout": "2. If the member is a two- or four-component vector with components consuming N basic machine units, the base alignment is 2N or 4N, respectively." [...] "4. If the member is an array of scalars or vectors, the base alignment and array stride are set to match the base alignment of a single array element, according to rules (1), (2), and (3), and rounded up to the base alignment of a vec4." [...] "7. If the member is a row-major matrix with C columns and R rows, the matrix is stored identically to an array of R row vectors with C components each, according to rule (4)." [...] "When using the std430 storage layout, shader storage blocks will be laid out in buffer storage identically to uniform and shader storage blocks using the std140 layout, except that the base alignment and stride of arrays of scalars and vectors in rule 4 and of structures in rule 9 are not rounded up a multiple of the base alignment of a vec4." In summary: vec2 has a base alignment of 2*N, a row-major mat2xY is stored like an array of Y row vectors with 2 components each. Because of std430 storage layout, the base alignment of the array of vectors is not rounded up to vec4, so it is still 2*N. Fixes 15 dEQP tests: dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_lowp_mat2 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_mediump_mat2 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_highp_mat2 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_lowp_mat2x3 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_mediump_mat2x3 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_highp_mat2x3 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_lowp_mat2x4 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_mediump_mat2x4 dEQP-GLES31.functional.ssbo.layout.single_basic_type.std430.row_major_highp_mat2x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat2 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat2x3 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat2x4 dEQP-GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major_mat2 dEQP-GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major_mat2x3 dEQP-GLES31.functional.ssbo.layout.instance_array_basic_type.std430.row_major_mat2x4 v2: - Add spec quote in both commit log and code (Timothy) Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]>
* r600/vce: enable VCE for trinity/richlandChristian König2015-10-131-1/+21
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* r600/uvd: disable UVD tiling by defaultChristian König2015-10-131-3/+5
| | | | | | | It has only minimal advantages for post processing and doesn't work with VCE. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* r600g: Enable GL_ARB_gpu_shader5 extensionGlenn Kennard2015-10-133-9/+10
| | | | | Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g/sb: SB support for UBO indexingGlenn Kennard2015-10-1311-27/+140
| | | | | Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g/sb: Support gs5 sampler indexing (v2)Glenn Kennard2015-10-139-25/+195
| | | | | | | [airlied: v2 cayman fixups] Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965/vs: Simplify fs_visitor's ATTR file.Kenneth Graunke2015-10-123-21/+49
| | | | | | | | | | | | | | | | | | Previously, ATTR was indexed by VERT_ATTRIB_* slots; at the end of compilation, assign_vs_urb_setup() translated those into GRF units, and converted ATTR to HW_REGs. This patch moves the transslation earlier, making ATTR work in terms of GRF units from the beginning. assign_vs_urb_setup() simply has to add the number of payload registers and push constants to obtain the final hardware GRF number. (We can't do this earlier as those values aren't known.) ATTR still supports reg_offset; however, it's simply added to reg. It's not clear whether this is valuable or not. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* nouveau: avoid double-emitting fenceIlia Mirkin2015-10-121-1/+5
| | | | | | | | | | | The act of ensuring that there is space can cause a flush to happen, which will emit the current screen fence. If that is the fence we're trying to wait on, then it will have been emitted as a result of doing the PUSH_SPACE. Don't attempt to emit it a second time. Signed-off-by: Ilia Mirkin <[email protected]> Fixes: 8053c9208f (nouveau: avoid emitting new fences unnecessarily) Cc: [email protected]
* glsl: Never allow the sequence operator anywhere in an array sizeIan Romanick2015-10-121-1/+1
| | | | | | | | | | | Fixes: spec/glsl-1.20/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert spec/glsl-es-1.00/compiler/array-sized-by-sequence-in-parenthesis.vert spec/glsl-es-3.00/compiler/array-sized-by-sequence-in-parenthesis.vert Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: In later GLSL versions, sequence operator is cannot be a constant ↵Ian Romanick2015-10-121-1/+42
| | | | | | | | | | | | | | | | | expression Fixes: ES3-CTS.shaders.negative.constant_sequence spec/glsl-es-3.00/compiler/global-initializer/from-sequence.vert spec/glsl-es-3.00/compiler/global-initializer/from-sequence.frag v2: Fix a couple copy-and-paste mistake in the spec quotations. Suggested by Matt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "10.6 11.0" <[email protected]>
* glsl: Add method to determine whether an expression contains the sequence ↵Ian Romanick2015-10-123-0/+97
| | | | | | | | | | | | | | | | | operator This will be used in the next patch to enforce some language sematics. v2: Fix inverted logic in ast_function_expression::has_sequence_subexpression. The method originally had a different name and a different meaning. I fixed the logic in ast_to_hir.cpp, but I only changed the names in ast_function.cpp. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]> [v1] Reviewed-by: Matt Turner <[email protected]> Cc: "10.6 11.0" <[email protected]>
* glsl: Restrict initializers for global variables to constant expression in ESIan Romanick2015-10-121-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: Combine this check with the existing const and uniform checks. This change depends on the previous patch (glsl: Only set ir_variable::constant_value for const-decorated variables). Fixes: ES2-CTS.shaders.negative.initialize ES3-CTS.shaders.negative.initialize spec/glsl-es-1.00/compiler/global-initializer/from-attribute.vert spec/glsl-es-1.00/compiler/global-initializer/from-uniform.vert spec/glsl-es-1.00/compiler/global-initializer/from-uniform.frag spec/glsl-es-1.00/compiler/global-initializer/from-global.vert spec/glsl-es-1.00/compiler/global-initializer/from-global.frag spec/glsl-es-1.00/compiler/global-initializer/from-varying.frag spec/glsl-es-3.00/compiler/global-initializer/from-uniform.vert spec/glsl-es-3.00/compiler/global-initializer/from-uniform.frag spec/glsl-es-3.00/compiler/global-initializer/from-in.vert spec/glsl-es-3.00/compiler/global-initializer/from-in.frag spec/glsl-es-3.00/compiler/global-initializer/from-global.vert spec/glsl-es-3.00/compiler/global-initializer/from-global.frag Note: spec/glsl-es-3.00/compiler/global-initializer/from-sequence.* still fail because the result of a sequence operator is still considered to be a constant expression. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92304 Reviewed-by: Tapani Pälli <[email protected]> [v1] Reviewed-by: Iago Toral Quiroga <[email protected]> [v1] Reviewed-by: Matt Turner <[email protected]> Cc: "10.6 11.0" <[email protected]>
* glsl: Only set ir_variable::constant_value for const-decorated variablesIan Romanick2015-10-121-3/+6
| | | | | | | | | | Right now we're also setting for uniforms, and that doesn't seem to hurt things. The next patch will make general global variables in GLSL ES, and those definitely should not have constant_value set! Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "10.6 11.0" <[email protected]>
* glsl: Use constant_initializer instead of constant_value to determine ↵Ian Romanick2015-10-121-1/+1
| | | | | | | | | | | whether to keep an unused uniform This even matches the comment "uniform initializers are precious, and could get used by another stage." Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "10.6 11.0" <[email protected]>