summaryrefslogtreecommitdiffstats
path: root/src/glsl/tests
Commit message (Collapse)AuthorAgeFilesLines
* glsl: reduce memory footprint of uniform_storage structTimothy Arceri2015-10-051-4/+4
| | | | | | | | The uniform will only be of a single type so store the data for opaque types in a single array. Cc: Francisco Jerez <currojerez@riseup.net> Cc: Ilia Mirkin <imirkin@alum.mit.edu>
* glsl: Add constuctors for the common cases of glsl_struct_fieldIan Romanick2015-08-032-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixes a giant pile of GCC warnings: builtin_types.cpp:60:1: warning: missing initializer for member 'glsl_struct_field::stream' [-Wmissing-field-initializers] I had to add a default constructor because a non-default constructor was added. Otherwise the only constructor would be the one with parameters, and all the plases like glsl_struct_field foo; would fail to compile. I wanted to do this in two patches. All of the initializers of glsl_struct_field structures had to be converted to use the constructor because C++ apparently forces you to do one or the other: builtin_types.cpp:61:1: error: could not convert '{glsl_type::float_type, "near", -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0, -1}' from '<brace-enclosed initializer list>' to 'glsl_struct_field' Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
* glsl/types: add new subroutine type (v3.2)Dave Airlie2015-07-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This type will be used to store the name of subroutine types as in subroutine void myfunc(void); will store myfunc into a subroutine type. This is required to the parser can identify a subroutine type in a uniform decleration as a valid type, and also for looking up the type later. Also add contains_subroutine method. v2: handle subroutine to int comparisons, needed for lowering pass. v3: do subroutine to int with it's own IR operation to avoid hacking on asserts (Kayden) v3.1: fix warnings in this patch, fix nir, fix tgsi v3.2: fixup tests Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Signed-off-by: Dave Airlie <airlied@redhat.com> tests: fix warnings
* glsl/tests: fix varying_test since tess changes.Dave Airlie2015-07-231-1/+1
| | | | | | | This fixes make check since the tess changes. Tested-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* mesa; add a dummy _mesa_error_no_memory() symbol to libglsl_utilEmil Velikov2015-06-121-30/+0
| | | | | | | | | | | | Rather than forcing everyone to provide their own definition of the symbol provide a common (dummy) one. This helps us resolve the build of the standalone pipe-drivers (amongst others), which are missing the symbol. Cc: Rob Clark <robclark@freedesktop.org> Cc: "10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* mesa: reference built-in uniforms into gl_uniform_storageMartin Peres2015-06-041-2/+2
| | | | | | | | | | | | | | | This change introduces a new field in gl_uniform_storage to explicitely say that a uniform is built-in. In the case where it is, no storage is defined to make it clear that it is read-only from the mesa side. I fixed all the places in the code that made use of the structure that I changed. Any place making a wrong assumption and using the storage straight away will just crash. This patch seems to implement the path of least resistance towards listing built-in uniforms in GL_ACTIVE_UNIFORM (and other APIs). Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
* glsl: replace Elements() with ARRAY_SIZE()Brian Paul2015-03-022-6/+6
| | | | Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
* glsl/tests: add DOUBLE typesIlia Mirkin2015-02-191-0/+9
| | | | | Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com>
* glsl/tests: add IMAGE type.Ilia Mirkin2015-02-171-0/+3
| | | | | | | | This fixes a warning when running make check. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* glsl: Add unit tests for blob.cCarl Worth2015-01-162-0/+321
| | | | | | In addition to exercising all of the functions in blob.h, this includes a stress test that forces some reallocing, and also tests to verify the alignment and overrun-detection code in blob.c.
* glsl: Use UniformBooleanTrue value for uniform initializers.Matt Turner2014-08-184-20/+29
| | | | Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* util: Move ralloc to a new src/util directory.Kenneth Graunke2014-08-049-46/+5
| | | | | | | | | | | | | | | | | | For a long time, we've wanted a place to put utility code which isn't directly tied to Mesa or Gallium internals. This patch creates a new src/util directory for exactly that purpose, and builds the contents as libmesautil.la. ralloc seemed like a good first candidate. These days, it's directly used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl didn't make much sense. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> v2 (Jason Ekstrand): More realloc uses and some scons fixes Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* glsl: Use typed foreach_in_list instead of foreach_list.Matt Turner2014-07-011-20/+20
| | | | Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl/tests: remove generated tests from the repoConnor Abbott2014-05-2849-696/+2
| | | | | | | | They were made unneccesary by the last commit. Signed-off-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
* glsl/tests: call create_test_cases.py in optimization-testConnor Abbott2014-05-281-0/+8
| | | | | | | | | | | | | | This way, when someone modifies create_test_cases.py and forgets to commit their changes again, people will notice. v2: make sure we parse the right directories and check for existance the right way. v3 (Ken): Use $PYTHON2 instead of calling python directly. Signed-off-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
* glsl/tests/lower_jumps: fix generated sexpr's for loopsConnor Abbott2014-05-281-1/+1
| | | | | | | | | | | | | | In 088494aa (as well as other commits in the series) Paul Berry modified the tests for lower_jumps to account for the fact that the s-expression for the loop IR instruction changed from (loop () () () () (statements...)) to (loop (statements...)), but he forgot to update create_test_cases.py which he used to create the tests. Fix that, so that now create_test_cases.py is synced with the generated tests. Signed-off-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
* glsl: be more consistent about printing constantsConnor Abbott2014-05-2822-47/+39
| | | | | | | | | | | | Make sure that we print the same number of digits when printing 0.0 as any other floating-point number. This will make generating expected output files for tests easier. To avoid breaking "make check," update the generated tests for lower_jumps before the next commit which will bring create_test_cases.py in line with them. Signed-off-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
* linker: Fix consumer_inputs_with_locations indexingIan Romanick2014-05-071-6/+5
| | | | | | | | | | | | | | | | | | | | | In an earlier incarnation of populate_consumer_input_sets and get_matching_input, the consumer_inputs_with_locations array was indexed using the user-specified location. In that version, only user-defined varyings were included in the array. In the current incarnation, the Mesa location is used to index the array, and built-in varyings are included. This change fixes the unit test to exepect gl_ClipDistance in the array, and it resizes the arrays to actually be big enough. It's just dumb luck that the existing piglit tests use small enough locations to not stomp the stack. :( Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78258 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Cc: Vinson Lee <vlee@freedesktop.org>
* mesa: Add _mesa_error_no_memory for logging out-of-memory messagesIan Romanick2014-05-021-0/+30
| | | | | | | | | | This can be called from locations that don't have a context pointer handy. This patch also adds enough infrastructure so that the unit tests for the GLSL compiler and the stand-alone compiler will build and function. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
* linker: Modify cross_validate_outputs_to_inputs to match using explicit ↵Ian Romanick2014-05-021-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | locations This will be used for GL_ARB_separate_shader_objects. That extension not only allows separable shaders to rendezvous by location, but it also allows traditionally linked shaders to rendezvous by location. The spec says: 36. How does the behavior of input/output interface matching differ between separable programs and non-separable programs? RESOLVED: The rules for matching individual variables or block members between stages are identical for separable and non-separable programs, with one exception -- matching variables of different type with the same location, as discussed in issue 34, applies only to separable programs. However, the ability to enforce matching requirements differs between program types. In non-separable programs, both sides of an interface are contained in the same linked program. In this case, if the linker detects a mismatch, it will generate a link error. v2: Make sure consumer_inputs_with_locations is initialized when consumer is NULL. Noticed by Chia-I. v3: Rebase on removal of ir_variable::user_location. v4: Replace a (stale) FINISHME with some good explanation comments from Eric. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* linker: Refactor code that gets an input matching an outputIan Romanick2014-05-021-0/+80
| | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Exit when the shader IR contains an interface block instanceIan Romanick2014-05-021-25/+46
| | | | | | | | | | | While writing the link_varyings::single_interface_input test, I discovered that populate_consumer_input_sets assumes that all shader interface blocks have been lowered to discrete variables. Since there is a pass that does this, it is a reasonable assumption. It was, however, non-obvious. Make the code fail when it encounters such a thing, and add a test to verify that behavior. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl/tests: Add first simple tests of populate_consumer_input_setsIan Romanick2014-05-021-0/+246
| | | | | | | | | | | | | | | | | | | Four initial tests: * Create an IR list with a single input variable and verify that variable is the only thing in the hash tables. * Same as the previous test, but use a built-in variable (gl_ClipDistance) with an explicit location set. * Create an IR list with a single input variable from an interface block and verify that variable is the only thing in the hash tables. * Create an IR list with a single input variable and a single input variable from an interface block. Verify that each is the only thing in the proper hash tables. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Add helper methods to glsl_type for dealing with images.Francisco Jerez2014-02-121-1/+1
| | | | | | | | | | | | Add predicates to query if a GLSL type is or contains an image. Rename sampler_coordinate_components() to coordinate_components(). v2: Use assert instead of unreachable. v3: No need to use a separate code-path for images in coordinate_components() after merging image and sampler fields in the glsl_type structure. Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl: Change _mesa_glsl_parse_state ctor to use gl_shader_stage enum.Paul Berry2014-01-081-1/+1
| | | | | | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> v2: Also rename "target" param to "stage". Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Store gl_shader_stage enum in gl_shader objects.Paul Berry2014-01-081-0/+1
| | | | | Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: Clean up nomenclature for pipeline stages.Paul Berry2014-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we had an enum called gl_shader_type which represented pipeline stages in the order they occur in the pipeline (i.e. MESA_SHADER_VERTEX=0, MESA_SHADER_GEOMETRY=1, etc), and several inconsistently named functions for converting between it and other representations: - _mesa_shader_type_to_string: gl_shader_type -> string - _mesa_shader_type_to_index: GLenum (GL_*_SHADER) -> gl_shader_type - _mesa_program_target_to_index: GLenum (GL_*_PROGRAM) -> gl_shader_type - _mesa_shader_enum_to_string: GLenum (GL_*_{SHADER,PROGRAM}) -> string This patch tries to clean things up so that we use more consistent terminology: the enum is now called gl_shader_stage (to emphasize that it is in the order of pipeline stages), and the conversion functions are: - _mesa_shader_stage_to_string: gl_shader_stage -> string - _mesa_shader_enum_to_shader_stage: GLenum (GL_*_SHADER) -> gl_shader_stage - _mesa_program_enum_to_shader_stage: GLenum (GL_*_PROGRAM) -> gl_shader_stage - _mesa_progshader_enum_to_string: GLenum (GL_*_{SHADER,PROGRAM}) -> string In addition, MESA_SHADER_TYPES has been renamed to MESA_SHADER_STAGES, for consistency with the new name for the enum. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> v2: Also rename the "target" field of _mesa_glsl_parse_state and the "target" parameter of _mesa_shader_stage_to_string to "stage". Reviewed-by: Brian Paul <brianp@vmware.com>
* glsl: move variables in to ir_variable::data, part IITapani Pälli2013-12-122-86/+86
| | | | | | | | | | | | | This patch moves following bitfields and variables to the data structure: explicit_location, explicit_index, explicit_binding, has_initializer, is_unmatched_generic_inout, location_frac, from_named_ifc_block_nonarray, from_named_ifc_block_array, depth_layout, location, index, binding, max_array_access, atomic Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl: move variables in to ir_variable::data, part ITapani Pälli2013-12-121-10/+10
| | | | | | | | | | This patch moves following bitfields in to the data structure: used, assigned, how_declared, mode, interpolation, origin_upper_left, pixel_center_integer Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl: introduce data section to ir_variableTapani Pälli2013-12-121-1/+1
| | | | | | | | Data section helps serialization and cloning of a ir_variable. This patch includes the helper bits used for read only ir_variables. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl/loops: Get rid of lower_bounded_loops and ir_loop::normative_bound.Paul Berry2013-12-0930-30/+30
| | | | | | | | Now that loop_controls no longer creates normatively bound loops, there is no need for ir_loop::normative_bound or the lower_bounded_loops pass. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl/loops: replace loop controls with a normative bound.Paul Berry2013-12-0930-30/+30
| | | | | | | | | | | | | | This patch replaces the ir_loop fields "from", "to", "increment", "counter", and "cmp" with a single integer ("normative_bound") that serves the same purpose. I've used the name "normative_bound" to emphasize the fact that the back-end is required to emit code to prevent the loop from running more than normative_bound times. (By contrast, an "informative" bound would be a bound that is informational only). Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Use more portable bash invocation construct.Vinson Lee2013-11-2026-26/+26
| | | | | | | | | Fixes 'make check' on distros where bash is not at /bin/bash. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Tested-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Add new atomic_uint built-in GLSL type.Francisco Jerez2013-10-291-0/+3
| | | | | | | | | v2: Fix GLSL version in which the type became available. Add contains_atomic() convenience method. Split off atomic counter comparison error checking to a separate patch that will handle all opaque types. Include new ir_variable fields for atomic types. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glsl: Simplify the interface to link_invalidate_variable_locationsIan Romanick2013-10-221-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The unit tests added in the previous commits prove some things about the state of some internal data structures. The most important of these is that all built-in input and output variables have explicit_location set. This means that link_invalidate_variable_locations doesn't need to know the range of non-generic shader inputs or outputs. It can simply reset location state depending on whether explicit_location is set. There are two additional assumptions that were already implicit in the code that comments now document. - ir_variable::is_unmatched_generic_inout is only used by the linker when connecting outputs from one shader stage to inputs of another shader stage. - Any varying that has explicit_location set must be a built-in. This will be true until GL_ARB_separate_shader_objects is supported. As a result, the input_base and output_base parameters to link_invalidate_variable_locations are no longer necessary, and the code for resetting locations and setting is_unmatched_generic_inout can be simplified. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl/tests: Unit test vertex shader in / out with ↵Ian Romanick2013-10-221-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | link_invalidate_variable_locations Validates: - ir_variable::explicit_location should not be modified. - If ir_variable::explicit_location is not set, ir_variable::location, ir_variable::location_frac, and ir_variable::is_unmatched_generic_inout must be reset to 0. - If ir_variable::explicit_location is set, ir_variable::location should not be modified. ir_variable::location_frac, and ir_variable::is_unmatched_generic_inout must be reset to 0. Previous unit tests have shown that all non-generic inputs / outputs have explicit_location set. v2: Split the link_invalidate_variable_locations interface change out to a separate patch. Remove the vertex_in_builtin_without_explicit and vertex_out_builtin_without_explicit tests. There was a lot of good discussion about this on the mailing list to which I refer the interested reader. Both changes suggested by Paul. http://lists.freedesktop.org/archives/mesa-dev/2013-October/046652.html Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl/tests: Verify geometry shader built-ins generated by ↵Ian Romanick2013-10-221-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | _mesa_glsl_initialize_variables Checks that the variables generated meet certain criteria. - Geometry shader inputs have an explicit location. - Geometry shader outputs have an explicit location. - Fragment shader-only varying locations are not used. - Geometry shader uniforms and system values don't have an explicit location. - Geometry shader constants don't have an explicit location and are read-only. - No other kinds of geometry variables exist. It does not verify that an specific variables exist. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl/tests: Verify fragment shader built-ins generated by ↵Ian Romanick2013-10-221-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | _mesa_glsl_initialize_variables Checks that the variables generated meet certain criteria. - Fragment shader inputs have an explicit location. - Fragment shader outputs have an explicit location. - Vertex / geometry shader-only varying locations are not used. - Fragment shader uniforms and system values don't have an explicit location. - Fragment shader constants don't have an explicit location and are read-only. - No other kinds of fragment variables exist. It does not verify that an specific variables exist. v2: Use _mesa_varying_slot_in_fs in fragment_builtin.inputs_have_explicit_location. Suggested by Paul. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl/tests: Verify vertex shader built-ins generated by ↵Ian Romanick2013-10-221-0/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _mesa_glsl_initialize_variables Checks that the variables generated meet certain criteria. - Vertex shader inputs have an explicit location. - Vertex shader outputs have an explicit location. - Fragment shader-only varying locations are not used. - Vertex shader uniforms and system values don't have an explicit location. - Vertex shader constants don't have an explicit location and are read-only. - No other kinds of vertex variables exist. It does not verify that an specific variables exist. v2: Fix memory management mistakes in common_builtin::string_starts_with_prefix. Clean up error message reporting in common_builtin::no_invalid_variable_modes. Both suggested by Paul. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl: When constructing a variable with an interface type, set interface_typeIan Romanick2013-10-222-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ever since the addition of interface blocks with instance names, we have had an implicit invariant: var->type->is_interface() == (var->type == var->interface_type) The odd use of == here is intentional because !var->type->is_interface() implies var->type != var->interface_type. Further, if var->type->is_array() is true, we have a related implicit invariant: var->type->fields.array->is_interface() == (var->type->fields.array == var->interface_type) However, the ir_variable constructor doesn't maintain either invariant. That seems kind of silly... and I tripped over it while writing some other code. This patch makes the constructor do the right thing, and it introduces some tests to verify that behavior. v2: Add general-ir-test to .gitignore. Update the description of the ir_variable invariant for arrays in the commit message. Both suggested by Paul. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
* glsl/tests: Update .gitignore for new unit test.Kenneth Graunke2013-09-161-0/+1
| | | | | | I rarely run 'git status', so I failed to notice this was missing. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl/tests: Add a test for properties of sampler types.Kenneth Graunke2013-09-151-0/+101
| | | | | | | | | | | | For each sampler type, this tests that: - The base type is GLSL_TYPE_SAMPLER. - The dimensionality is set correctly. - The returned data type is correct. - The sampler_array and sampler_shadow flags are set correctly. - sampler_coordinate_components() returns the correct value. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <idr@freedesktop.org>
* glsl: Add heuristics to print floating-point numbers better.Matt Turner2013-08-2914-31/+31
| | | | | v2: Fix *.expected files to match. Reviewed-by: Paul Berry <strereotype441@gmail.com>
* mesa: fix GLSL program objects with more than 16 samplers combinedMarek Olšák2013-05-281-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The problem is the sampler units are allocated from the same pool for all shader stages, so if a vertex shader uses 12 samplers (0..11), the fragment shader samplers start at index 12, leaving only 4 sampler units for the fragment shader. The main cause is probably the fact that samplers (texture unit -> sampler unit mapping, etc.) are tracked globally for an entire program object. This commit adapts the GLSL linker and core Mesa such that the sampler units are assigned to sampler uniforms for each shader stage separately (if a sampler uniform is used in all shader stages, it may occupy a different sampler unit in each, and vice versa, an i-th sampler unit may refer to a different sampler uniform in each shader stage), and the sampler-specific variables are moved from gl_shader_program to gl_shader. This doesn't require any driver changes, and it fixes piglit/max-samplers for gallium and classic swrast. It also works with any number of shader stages. v2: - converted tabs to spaces - added an assertion to _mesa_get_sampler_uniform_value Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* glsl: Add GLSL_TYPE_INTERFACEIan Romanick2013-01-251-0/+3
| | | | | | | | | | | | | | | | | | | | | Interfaces are structurally identical to structures from the compiler's point of view. They have some additional restrictions, and generally GPUs use different instructions to access them. Using a different base type should make this a bit easier. This commit also adds the glsl_type::interface_packing fields. For GLSL_TYPE_INTERFACE types, this will track the specified packing mode. It is analogous to gl_uniform_buffer::_Packing. v2: Add serveral missing GLSL_TYPE_INTERFACE cases in switch-statements. v3: Add information about glsl_type::interface_packing. Move row_major checking in glsl_type::record_key_compare from this patch to the previous patch. Both suggested by Paul Berry. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glsl/build: Build tests via the glsl MakefileMatt Turner2013-01-222-37/+8
| | | | Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
* tests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).Johannes Obermayr2013-01-131-4/+5
| | | | Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
* Clean up .gitignore filesMatt Turner2013-01-101-1/+0
|
* src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGSMatt Turner2012-10-251-4/+1
| | | | | | | | | | | | | When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS are not used. AM_CPPFLAGS should be used for includes anyway. Fixes a build problem since 41b14d125: CC ralloc_test-ralloc.o In file included from ../../../src/glsl/ralloc.c:42:0: ../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory Acked-by: Paul Berry <stereotype441@gmail.com>
* build: Use PTHREAD_LIBS and PTHREAD_CFLAGSMatt Turner2012-10-011-3/+5
|