summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Add an optimization pass to flatten simple nested if blocks.Kenneth Graunke2013-04-044-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLBenchmark 2.7's shaders contain conditional blocks like: if (x) { if (y) { ... } } where the outer conditional's then clause contains exactly one statement (the nested if) and there are no else clauses. This can easily be optimized into: if (x && y) { ... } This saves a few instructions in GLBenchmark 2.7: total instructions in shared programs: 11833 -> 11649 (-1.55%) instructions in affected programs: 8234 -> 8050 (-2.23%) It also helps CS:GO slightly (-0.05%/-0.22%). More importantly, however, it simplifies the control flow graph, which could enable other optimizations. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Revert "glsl: Replace constant-index vector array accesses with swizzles"Paul Berry2013-04-022-83/+83
| | | | | | | This reverts commit dbf94d105a48b7aafb2c8cf64d8b4392d87efea1, which was working around a bug in the handling of array indexing when constant folding built-in functions. Now that the constant folding bug has been fixed, the workaround is no longer needed.
* glsl: Fix array indexing when constant folding built-in functions.Paul Berry2013-04-021-1/+1
| | | | | | | | | | | | | | | | | | | Mesa constant-folds built-in functions by using a miniature GLSL interpreter (see ir_function_signature::constant_expression_evaluate_expression_list()). This interpreter had a bug in its handling of array indexing, which caused expressions like "m[i][j]" (where m is a matrix) to be handled incorrectly. Specifically, it incorrectly treated j as indexing into the whole matrix (rather than indexing just into the vector m[i]); as a result the offset computed for m[i] was lost and m[i][j] was treated as m[j][0]. Fixes piglit tests inverse-mat[234].{vert,frag}. NOTE: This is a candidate for the 9.1 and 9.0 branches. Reviewed-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57436
* GLSL: fix lower_jumps to report progress properlyAras Pranckevicius2013-04-011-1/+3
| | | | | | | | | A fix for lower_jumps progress reporting, very much like similar in c1e591eed. NOTE: This is a candidate for stable branches. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Generated masked write instead of vector array index for UBO loweringIan Romanick2013-03-291-7/+3
| | | | | | | | | | | | | | | When reading a column from a row-major matrix, we would slot the single value read into the vector using an ir_dereference_array of the vector with a constant index. This will (eventually) get optimized to a masked-write, so just generate the masked write in the first place. v2: Remove unused variable 'chan'. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Cc: Eric Anholt <[email protected]>
* glsl: Replace open-coded dot-product with dotIan Romanick2013-03-291-4/+5
| | | | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Cc: Eric Anholt <[email protected]> Cc: Paul Berry <[email protected]>
* glsl: Replace constant-index vector array accesses with swizzlesIan Romanick2013-03-292-87/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Search and replace: ][0] -> ].x ][1] -> ].y ][2] -> ].z ][3] -> ].w Fixes piglit tests inverse-mat[234].{vert,frag}. These tests call the inverse function with constant parameters and expect proper constant folding to happen. My suspicion is that this patch papers over some bug in constant propagation involving array accesses. Either way, all of these accesses eventually get lowered to swizzles. This cuts out the middle man (saving a trivial amount of CPU). NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Cc: Eric Anholt <[email protected]> Cc: Paul Berry <[email protected]>
* glsl: Add missing bool case in glsl_type::get_scalar_typeIan Romanick2013-03-291-0/+2
| | | | | | | | | | | | Since the case was missing bec4->get_scalar_type() would return bvec4, but vec4->get_scalar_type() would return float. NOTE: This is a candidate for stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Implement ARB_texture_query_lodDave Airlie2013-03-2915-18/+96
| | | | | | | | | | | | | | | | | | | v2 [mattst88]: - Rebase. - #define GL_ARB_texture_query_lod to 1. - Remove comma after ir_lod in ir.h for MSVC. - Handled ir_lod in ir_hv_accept.cpp, ir_rvalue_visitor.cpp, opt_tree_grafting.cpp. - Rename textureQueryLOD to textureQueryLod, see https://www.khronos.org/bugzilla/show_bug.cgi?id=821 - Fix ir_reader of (lod ...). v3 [mattst88]: - Rename textureQueryLod to textureQueryLOD, pending resolution of Khronos 821. - Add ir_lod case to ir_to_mesa.cpp. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl ir: add as_dereference_recordJordan Justen2013-03-251-0/+6
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Disable validate_ir_tree() on release builds.Eric Anholt2013-03-252-2/+6
| | | | | | | | | Since half of ir_validate uses asserts() (the other using printf() then abort()), there's not much use to calling it in a release build. Cuts 6.3% of the startup time of TF2. NOTE: This is a candidate for the stable branches. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add built-in functions for GLSL 1.50.Kenneth Graunke2013-03-202-0/+1145
| | | | | | | | | | | | This makes basic built-in functions work in GLSL 1.50. It supports everything except the new Geometry Shader functions. The new 150.glsl file is 140.glsl plus ARB_texture_multisample.glsl; 150.frag is identical to 140.frag except for the #version bump. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* glsl: Add sampler2DMS/sampler2DMSArray types to GLSL 1.50.Kenneth Graunke2013-03-202-1/+12
| | | | | | | | | GLSL 1.50 includes support for the new sampler types introduced by the ARB_texture_multisample extension. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* glsl: Bump standalone compiler versions to 1.50.Kenneth Graunke2013-03-202-3/+3
| | | | | | | | The version bumps are necessary in order to compile built-ins for 1.50. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* Replace gl_frag_attrib enum with gl_varying_slot.Paul Berry2013-03-155-23/+22
| | | | | | | | | | | | This patch makes the following search-and-replace changes: gl_frag_attrib -> gl_varying_slot FRAG_ATTRIB_* -> VARYING_SLOT_* FRAG_BIT_* -> VARYING_BIT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* Replace gl_vert_result enum with gl_varying_slot.Paul Berry2013-03-155-15/+15
| | | | | | | | | | | This patch makes the following search-and-replace changes: gl_vert_result -> gl_varying_slot VERT_RESULT_* -> VARYING_SLOT_* Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: Report ARB_debug_output for both shader errors and warnings.Eric Anholt2013-03-053-10/+9
| | | | | | | | This ends up reusing the dynamic ID support, so a silly enum gets to go away. We don't assign good IDs to different messages yet, but at least that's tractable now. Reviewed-by: Jordan Justen <[email protected]>
* glsl: add support for ARB_texture_multisampleChris Forbes2013-03-0220-26/+153
| | | | | | | | | | | | | | | | | | V2: - emit `sample` parameter properly for multisample texelFetch() - fix spurious whitespace change - introduce a new opcode ir_txf_ms rather than overloading the existing ir_txf further. This makes doing the right thing in the driver somewhat simpler. V3: - fix weird whitespace V4: - don't forget to include the new opcode in tex_opcode_strs[] (thanks Kenneth for spotting this) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Eric Anholt <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: allow GLSL compiler version to be overridden to 1.50Jordan Justen2013-02-282-0/+3
| | | | | | | | | | | | | Although GLSL 1.50 compiler support is not available, this change will allow MESA_GLSL_VERSION_OVERRIDE=150 to be used while 1.50 support is being developed. Since no drivers claim 1.50 GLSL support, this change should only impact Mesa when MESA_GLSL_VERSION_OVERRIDE=150 is set. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Optimize ir_triop_lrp(x, y, a) with a = 0.0f or 1.0fMatt Turner2013-02-281-0/+11
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Convert mix() to use a new ir_triop_lrp opcode.Kenneth Graunke2013-02-288-10/+76
| | | | | | | | | | | | | | | | | | | | | | | | Many GPUs have an instruction to do linear interpolation which is more efficient than simply performing the algebra necessary (two multiplies, an add, and a subtract). Pattern matching or peepholing this is more desirable, but can be tricky. By using an opcode, we can at least make shaders which use the mix() built-in get the more efficient behavior. Currently, all consumers lower ir_triop_lrp. Subsequent patches will actually generate different code. v2 [mattst88]: - Add LRP_TO_ARITH flag to ir_to_mesa.cpp. Will be removed in a subsequent patch and ir_triop_lrp translated directly. v3 [mattst88]: - Move changes from the next patch to opt_algebraic.cpp to accept 3-src operations. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Rework ir_reader to handle expressions with three operands.Kenneth Graunke2013-02-281-26/+19
| | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Consolidate ir_expression constructors that use explicit types.Kenneth Graunke2013-02-282-37/+10
| | | | | | | | | | | | | | | | | | | Previously, we had separate constructors for one, two, and four operand expressions. This patch consolidates them into a single constructor which uses NULL default parameters. The unary and binary operator constructors had assertions to verify that the caller supplied the correct number of operands for the expression, but the four-operand version did not. Since get_num_operands for ir_quadop_vector returns the number of vector_elements, we can safely add that without breaking the semantics of ir_quadop_vector. This also paves the way for expressions with three operands. Currently, none can be constructed since get_num_operands() never returns 3. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Remove VS output varyings which are optimized out of the FSJordan Justen2013-02-231-1/+18
| | | | | | | | | | | | | Previously when an input varying was optimized out of the FS we would still retain it as an output of the VS. We now build a hash of live FS input varyings rather than looking in the FS symbol table. (The FS symbol table will still contain the optimized out varyings.) Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Initialize ir_texture member variable.Vinson Lee2013-02-131-2/+2
| | | | | | | Fixes uninitialized pointer field defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix error checking on "flat" keyword to match GLSL ES 3.00, GLSL 1.50.Paul Berry2013-02-131-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the GLSL specs from GLSL 1.30 (and GLSL ES 3.00) onward contain language requiring certain integer variables to be declared with the "flat" keyword, but they differ in exactly *when* the rule is enforced: (a) GLSL 1.30 and 1.40 say that vertex shader outputs having integral type must be declared as "flat". There is no restriction on fragment shader inputs. (b) GLSL 1.50 through 4.30 say that fragment shader inputs having integral type must be declared as "flat". There is no restriction on vertex shader outputs. (c) GLSL ES 3.00 says that both vertex shader outputs and fragment shader inputs having integral type must be declared as "flat". Previously, Mesa's behaviour was consistent with (a). This patch makes it consistent with (b) when compiling desktop shaders, and (c) when compiling ES shaders. Rationale for desktop shaders: once we add geometry shaders, (b) really seems like the right choice, because it requires "flat" in just the situations where it matters. Since we may want to extend geometry shader support back before GLSL 1.50 (via ARB_geometry_shader4), it seems sensible to apply this rule to all GLSL versions. Also, this matches the behaviour of the nVidia proprietary driver for Linux, and the expectations of Intel's oglconform test suite. Rationale for ES shaders: since the behaviour specified in GLSL ES 3.00 matches neither pre-GLSL-1.50 nor post-GLSL-1.50 behaviour, it seems likely that this was a deliberate choice on the part of the GLES folks to be more restrictive. Also, the argument in favor of (b) doesn't apply to GLES, since it doesn't support geometry shaders at all. Some discussion about this has already happened on the Mesa-dev list. See: http://lists.freedesktop.org/archives/mesa-dev/2013-February/034199.html Fixes piglit tests: - glsl-1.30/compiler/interpolation-qualifiers/nonflat-*.frag - glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-0{2,3,4,5}.vert - glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-{int,uint}.frag Fixes oglconform tests: - glsl-q-inperpol negative.fragin.{int,uint,ivec,uvec} Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glsl: don't allow non-flat integral types in varying structs/arrays.Paul Berry2013-02-133-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the GLSL 1.30 spec, section 4.3.6 ("Outputs") says: "If a vertex output is a signed or unsigned integer or integer vector, then it must be qualified with the interpolation qualifier flat." The GLSL ES 3.00 spec further clarifies, in section 4.3.6 ("Output Variables"): "Vertex shader outputs that are, *or contain*, signed or unsigned integers or integer vectors must be qualified with the interpolation qualifier flat." (Emphasis mine.) The language in the GLSL ES 3.00 spec is clearly correct and should be applied to all shading language versions, since varyings that contain ints can't be interpolated, regardless of which shading language version is in use. (Note that in GLSL 1.50 the restriction is changed to apply to fragment shader inputs rather than vertex shader outputs, to accommodate the fact that in the presence of geometry shaders, vertex shader outputs are not necessarily interpolated. That will be addressed by a future patch). NOTE: This is a candidate for stable branches. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glsl: Allow default precision qualifiers to be set for sampler types.Paul Berry2013-02-131-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | From GLSL ES 3.00 section 4.5.4 ("Default Precision Qualifiers"): "The precision statement precision precision-qualifier type; can be used to establish a default precision qualifier. The type field can be either int or float or any of the sampler types, and the precision-qualifier can be lowp, mediump, or highp." GLSL ES 1.00 has similar language. GLSL 1.30 doesn't allow precision qualifiers on sampler types, but this seems like an oversight (since the intention of including these in GLSL 1.30 is to allow compatibility with ES shaders). Previously, Mesa followed GLSL 1.30 and only allowed default precision qualifiers to be set for float and int. This patch makes it follow GLSL ES rules in all cases. Fixes Piglit tests default-precision-sampler.{vert,frag}. Partially addresses https://bugs.freedesktop.org/show_bug.cgi?id=60737. NOTE: This is a candidate for stable branches. Reviewed-by: Eric Anholt <[email protected]>
* glsl: Fix unsupported version error for GLSL ES 3.00, future proof for 3.30.Paul Berry2013-02-122-54/+64
| | | | | | | | | | | | | | | | | | | | | | When the user specifies an unsupported GLSL version, _mesa_glsl_parse_state::process_version_directive() nicely gives them an error message telling them which GLSL versions are supported. Previous to this patch, the logic for determining whether a given language version was supported was independent from the logic to generate this error message string; as a result, we had a bug where GLSL 3.00 would never be listed in the error message as an available language version, even if it was really available. To make matters worse, the code for generating the error message string assumed that desktop GL versions were always separated by 0.10, an assumption that will be wrong as soon as we support GLSL 3.30. This patch fixes both problems by adding a table of supported GLSL versions to _mesa_glsl_parse_state; this table is used both to generate the error message and to check whether a given version is supported. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Ensure glsl_type constructors initialize gl_type.Vinson Lee2013-02-081-0/+2
| | | | | | | Fixes uninitialized scalar field defects reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glsl: Initialize all tfeedback_candidate_generator member variables.Vinson Lee2013-02-071-1/+3
| | | | | | | Fixes uninitialized pointer field defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Change loop_analysis to not look like a resource leakIan Romanick2013-02-072-8/+7
| | | | | | | | | | | | | | | Previously the loop_state was allocated in the loop_analysis constructor, but not freed in the (nonexistent) destructor. Moving the allocation of the loop_state makes this code appear less sketchy. Either way, there is no actual leak. The loop_state is freed by the single caller of analyze_loop_variables. Signed-off-by: Ian Romanick <[email protected]> Cc: Dave Airlie <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57753
* glsl: fix incorrect comment about do_common_optimizationMarek Olšák2013-02-061-2/+2
|
* glsl: Initialize ast_parameter_declarator member variables.Vinson Lee2013-02-051-4/+8
| | | | | | | Fixes uninitialized pointer field defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glsl: Support transform feedback of varying structs.Paul Berry2013-02-042-67/+184
| | | | | | | | | | | | | | | | | | | Since transform feedback needs to be able to access individual fields of varying structs, we can no longer match up the arguments to glTransformFeedbackVaryings() with variables in the vertex shader. Instead, we build up a hashtable which records information about each possible name that is a candidate for transform feedback, and then match up the arguments to glTransformFeedbackVaryings() with the contents of that hashtable. Populating the hashtable uses the program_resource_visitor infrastructure, so the logic is shared with how we handle uniforms. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Use parse_program_resource_name to parse transform feedback varyings.Paul Berry2013-02-042-19/+16
| | | | | | | | | | | | | | | | | | | Previously, transform feedback varyings were parsed in an ad-hoc fashion that wasn't compatible with structs (or array of structs). This patch makes it use parse_program_resource_name(), which correctly handles both. Note that parse_program_resource_name()'s technique for handling mal-formed input strings is to simply let them through and rely on the fact that a future name lookup will fail. Because of this, tfeedback_decl::init() no longer needs to return a boolean error code--it always succeeds, and if the input was mal-formed the error will be detected later. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Rename uniform_field_visitor to program_resource_visitor.Paul Berry2013-02-043-31/+32
| | | | | | | | | | | | | | | | There's actually nothing uniform-specific in uniform_field_visitor. It is potentially useful for all kinds of program resources (in particular, future patches will use it for transform feedback varyings). This patch renames it to program_resource_visitor, and clarifies several comments, to reflect the fact that it is useful for more than just uniforms. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/glsl: Separate parsing logic from _mesa_get_uniform_location.Paul Berry2013-02-042-0/+63
| | | | | | | | | | | | | | | | The parsing logic is moved to a new function in the GLSL module, parse_program_resource_name(). This name was chosen because it should eventually be useful for handling everything that OpenGL 4.3 calls "program resources" (e.g. uniforms, vertex inputs, fragment outputs, and transform feedback varyings). Future patches will make use of this function for linking transform feedback varyings. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* builtin_compiler/build: Don't use *_FOR_BUILD when not cross compilingMatt Turner2013-02-041-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | Previously we were relying on CFLAGS_FOR_BUILD to be the same as CFLAGS when not cross compiling, but this assumption didn't take into consideration 32-bit builds on 64-bit systems. More generally, not honoring CFLAGS is bad. Automake is evidently too stupid to accept if CROSS_COMPILING CC = @CC_FOR_BUILD@ ... else CC = @CC@ endif without warning that CC has been already defined. The warnings are harmless, but I'd prefer to avoid future reports about them, so define proxy variables, which are assigned inside the conditional and then unconditionally assigned to CC et al. NOTE: This is a candidate for the 9.1 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59737 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60038
* glsl: Remove hash table from ir_set_program_inouts pass.Kenneth Graunke2013-02-031-24/+14
| | | | | | | | | | | Back when ir_var_in and ir_var_out signified both function parameters and shader input/outputs, we had trouble distinguishing the two when looking at a dereference. Now that we have separate ir_var_shader_in and ir_var_shader_out modes, we can determine this easily. Removing the hash table saves memory and CPU overhead. Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: use glsl_strtof() instead of glsl_strtod()Brian Paul2013-01-252-8/+8
| | | | | | Since the result of those calls is always assigned to a float. Reviewed-by: Ian Romanick <[email protected]>
* glsl: add new glsl_strtof() functionBrian Paul2013-01-252-0/+25
| | | | | | | Note, we could alternately implement this in terms of glsl_strtod() with a (float) cast. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add support for lowering 4x8 pack/unpack operationsMatt Turner2013-01-252-0/+285
| | | | | | | Lower them to arithmetic and bit manipulation expressions. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Evaluate constant pack/unpack 4x8 expressionsMatt Turner2013-01-251-0/+166
| | | | | | | | | That is, evaluate constant expressions for the following functions: packSnorm4x8, unpackSnorm4x8 packUnorm4x8, unpackUnorm4x8 Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Extend ir_expression_operation for ARB_shading_language_packingMatt Turner2013-01-253-0/+27
| | | | | | | | | For each function {pack,unpack}{Snorm,Unorm}4x8, add a corresponding opcode to enum ir_expression_operation. Validate the new opcodes in ir_validate.cpp. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Add IR lisp for ARB_shading_language_packingMatt Turner2013-01-255-0/+38
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Add infrastructure for ARB_shading_language_packingMatt Turner2013-01-255-0/+8
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Remove ir_variable::uniform_blockIan Romanick2013-01-255-14/+0
| | | | | | | | | v2: A previous patch contained a spurious hunk that removed an assignment to ir_variable::uniform_block. That hunk was moved to this patch. Suggested by Carl Worth. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Allow dereferencing fields of an interface instanceIan Romanick2013-01-251-1/+2
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Allow elimination of uniform block membersIan Romanick2013-01-251-6/+1
| | | | | | | | | | | | | | | | | | | glGetActiveUniform is not supposed to report block members that are not active even if they are included in the layout of the block. The block layout is determined from the GLSL_TYPE_INTERFACE that defines the block, so eliminating the ir_variables that correspond to the individual fields is safe. Fixes gles3conform test uniform_buffer_object_getuniformindices_for_for_nonexistent_or_not_active_uniform_names. This also fixes the assertion failures (added in the previous commit) in gles3conform uniform_buffer_object_index_of_not_active_block, uniform_buffer_object_inherit_and_override_layouts, and uniform_buffer_object_repeat_global_scope_layouts. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>