summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/sampler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* program: remove extern "C" usage in sampler.cppBrian Paul2014-12-161-5/+4
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Add a new function for getting the nonconst sampler array indexChris Forbes2014-08-121-0/+11
| | | | | | | | | | | | | If the array index is not a constant expression, the existing support will assume a zero offset (giving us the sampler index of the base of the array). For dynamically uniform indexing of sampler arrays, we need both that and the indexing expression. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Clean up nomenclature for pipeline stages.Paul Berry2014-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> 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 <[email protected]>
* mesa: fix GLSL program objects with more than 16 samplers combinedMarek Olšák2013-05-281-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Rewrite the way uniforms are tracked and handledIan Romanick2011-11-071-7/+5
| | | | | | | | | | | | | | | | | | | | | Switch all of the code in ir_to_mesa, st_glsl_to_tgsi, glUniform*, glGetUniform, glGetUniformLocation, and glGetActiveUniforms to use the gl_uniform_storage structures in the gl_shader_program. A couple of notes: * Like most rewrite-the-world patches, this should be reviewed by applying the patch and examining the modified functions. * This leaves a lot of dead code around in linker.cpp and uniform_query.cpp. This will be deleted in the next patches. v2: Update the comment block (previously a FINISHME) in _mesa_uniform about generating GL_INVALID_VALUE when an out-of-range sampler index is specified. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Use Add linker_error instead of fail_linkIan Romanick2011-09-301-14/+3
| | | | | | | See also 8aadd89. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: support boolean and integer-based parameters in prog_parameterBryan Cain2011-08-011-1/+1
| | | | | | The functionality is not used by anything yet, and the glUniform functions will need to be reworked before this can reach its full usefulness. It is nonetheless a step towards integer support in the state tracker and classic drivers.
* Use C-style system headers in C++ code to avoid issues with std:: namespaceIan Romanick2011-02-211-1/+0
|
* Convert everything from the talloc API to the ralloc API.Kenneth Graunke2011-01-311-11/+9
|
* mesa: Fix C++ includes in sampler.cppChad Versace2010-11-021-4/+4
| | | | | | | | | Some C++ header files were included in an extern "C" block. When building with Clang, this caused the build to fail due to namespace errors. (GCC did not report any errors.) Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Pull ir_to_mesa's sampler number fetcher out to shared code.Eric Anholt2010-09-281-0/+140