aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins/tools
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Delete old built-in function generation code.Kenneth Graunke2013-09-095-1049/+0
| | | | | | | | None of this is used anymore. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Paul Berry <[email protected]>
* glsl: Bump standalone compiler versions to 3.30.Kenneth Graunke2013-08-251-2/+2
| | | | | | | These are necessary in order to compile the built-in functions. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: add builtins for geometry shaders.Bryan Cain2013-08-011-2/+4
| | | | | | | | | | | | | | v2 (Paul Berry <[email protected]>): Account for rework of builtin_variables.cpp. Use INTERP_QUALIFIER_FLAT for gl_PrimitiveID so that it will obey provoking vertex conventions. Convert to GLSL 1.50 style geometry shaders. Reviewed-by: Ian Romanick <[email protected]> v3 (Paul Berry <[email protected]>): Be less obscure about setting interpolation field of gl_Primitive variables. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add infrastructure for ARB_gpu_shader5.Matt Turner2013-05-061-0/+1
| | | | Reviewed-by: Chris Forbes <[email protected]>
* glsl: Implement ARB_texture_query_lodDave Airlie2013-03-292-11/+30
| | | | | | | | | | | | | | | | | | | 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: Bump standalone compiler versions to 1.50.Kenneth Graunke2013-03-201-2/+2
| | | | | | | | 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]>
* glsl: add support for ARB_texture_multisampleChris Forbes2013-03-022-6/+23
| | | | | | | | | | | | | | | | | | 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: Add infrastructure for ARB_shading_language_packingMatt Turner2013-01-251-0/+1
| | | | | Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Make builtin function profiles for GLSL ES use "es" in the filename.Paul Berry2012-12-061-1/+5
| | | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Simplify symbol table version checking.Paul Berry2012-12-061-1/+1
| | | | | | | | | | | Previously, we stored the GLSL language version in the glsl_symbol_table struct. But this was unnecessary--all glsl_symbol_table needs to know is whether functions and variables have separate namespaces (they do in GLSL 1.10 only). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* mesa: Add ARB_ES3_compatibility flag.Paul Berry2012-12-061-0/+1
| | | | | | | | | | | | | Adding this now makes it easier to develop and test GLES3 features, since we can do initial development and testing using desktop GL. Later GLSL compiler patches check for either ctx->Extensions.ARB_ES3_compatibility or _mesa_is_gles3 to allow certain features (i.e., "#version 300 es"). [v2, idr]: Just edits to the commit message. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* mesa: Rename API_OPENGL to API_OPENGL_COMPAT.Paul Berry2012-11-291-1/+1
| | | | | | | | | | This should help avoid confusion now that we're using the gl_api enum to distinguishing between core and compatibility API's. The corresponding enum value for core API's is API_OPENGL_CORE. Acked-by: Eric Anholt <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* glsl: add ARB_texture_cube_map_array support (v2)Dave Airlie2012-11-092-1/+20
| | | | | | | | | | | | This adds all the new builtins + the new sampler types, and hooks them up if the extension is supported. v2: fix missing signatures for grad/lod fix missing textureSize clarifications fix compare vs starts with usage Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: make builtin_mem_ctx a staticDave Airlie2012-09-151-1/+1
| | | | | | | This isn't used outside the generated file. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: Scaffolding for ARB_shader_bit_encoding.Olivier Galibert2012-06-071-0/+1
| | | | | | | | That adds support for activating the extension. It doesn't actually *do* anything yet, of course. Signed-off-by: Olivier Galibert <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl/builtins: Fix textureGrad() for Array samplers.Kenneth Graunke2012-06-051-3/+3
| | | | | | | | | | | | We were incorrectly assuming that the coordinate's dimensionality is equal to the gradient's dimensionality. For array types, the coordinate has one more component. Fixes 12 subcases of oglconform's glsl-bif-tex-grad test. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Add support for generating builtin code from GLSL instead of IR.Eric Anholt2012-04-241-4/+16
| | | | | | | | This takes advantage of the builtin compiler to generate IR into a string, the same way we read GLSL for function prototypes for our profiles. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl/builtins: Support stage-agnostic built-in profiles.Kenneth Graunke2012-04-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The built-in subsystem uses "profiles," or GLSL shaders containing prototypes for all built-ins supported within a particular language version (or extension) and shader stage. Since profiles were stage-specific, we had to cut and paste almost all the prototypes between (e.g.) 110.vert and 110.frag. Naturally, this led to sundry cut and paste bugs, where someone fixed an issue in .frag but neglected to update .vert, or vice-versa. Geometry shaders would have only made this worse. This patch introduces support for a new '.glsl' profile suffix which contains prototypes common to all shader stages. The existing '.frag' and '.vert' profiles need only contain the few stage-specific built-ins. Not only does this remove duplication, it makes built-in setup slightly faster: we don't need to re-read the common prototypes and function bodies for both the vertex and fragment shader stage. Internally, this was trivial. We already create a list of gl_shader objects to search through for built-ins: one for the core language version/stage, and additional shaders for any extensions in use. This patch simply adds another shader to the list: core/common, core/stage, and extensions. The next patch will update the profiles to remove the duplication. It's separated out purely to make review easier. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Ian Romanick <[email protected]>
* glsl: Add remaining *sampler2DRect* texture functions.Eric Anholt2012-04-161-0/+22
| | | | | | Fixes the new piglit texelFetch() tests on these. Note that the rest of the new functions are not tested (same as the non-2DRect versions of most of them).
* glsl: Add textureSize(*samplerBuffer) support.Eric Anholt2012-04-161-0/+1
| | | | | | Fixes the corresponding new tests in piglit. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Don't apply optimization passes to builtins.Eric Anholt2012-04-111-1/+1
| | | | | | The builtins we have are generally optimized, having been hand-written. This avoids generating bad code when an optimization pass prints debug output.
* glsl: Add texelFetch(*samplerBuffer) entrypoints to GLSL 1.40.Eric Anholt2012-04-091-4/+7
| | | | | | | | Fix texelFetch(sampler2DRect) and textureSize(samplerBuffer) generation to not reference a LOD at the same time because it's easier than not fixing it. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: initialise const force glsl extension warning in fake ctxDave Airlie2012-03-251-0/+1
| | | | | | | | | valgrind complained about an uninitialised value being used in glsl_parser_extras.cpp, and this was the one it was giving out about. Just initialise the value in the fakectx. Signed-off-by: Dave Airlie <[email protected]>
* glsl: Add GLSL 1.40 textureSize() implementations for sampler2DRect.Eric Anholt2012-03-151-2/+9
| | | | | | | | | | | | | By setting lod to 0 in the builtin function implementation, we avoid needing to update all the visitors to ignore LOD in this case, when the hardware drivers actually want to ask for LOD 0 for rectangular textures. Fixes piglit spec/GLSL-1.40/textureSize-*Rect. v2: Change style of looking for substrings. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Set up generated builtin functions handling for GLSL 1.40.Eric Anholt2012-03-151-3/+3
| | | | | | | Otherwise, when we go to use ir_reader on the generated code, we won't have the types present. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: When failing to compile some builtins, print the error.Eric Anholt2012-03-151-0/+8
| | | | | | | This makes the process slightly more debuggable, though it would be nice if the build just failed immediately instead. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix samplerCubeShadow support in shader compilerAnuj Phogat2011-12-071-1/+1
| | | | | | | | | | | This patch fixes the samplerCubeShadow support in GLSL shader compiler. shader compiler was picking the 'r' texture coordinate for shadow comparison when the expected behaviour is to use 'q' texture coordinate in case of cube shadow maps. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add missing textureSize(samplerCubeShadow, int) variant.Kenneth Graunke2011-11-161-0/+1
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Remove textureGradOffset built-ins taking samplerCube parameters.Kenneth Graunke2011-11-101-1/+0
| | | | | | | | | These simply don't exist in the 1.30 specification---none of the Offset variants allow samplerCube. This must have been a cut and paste error from textureGrad, which /does/ allow cubemaps. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-032-0/+8
| | | | | | | | | | This extension introduces a new sampler type: samplerExternalOES. texture2D (and texture2DProj) can be used to do a texture look up in an external texture. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add '.ir' extension to builtin IR filesPaul Berry2011-10-311-3/+9
| | | | | | | | This patch adds the extension '.ir' to all the files in src/glsl/builtins/ir/, and changes generate_builtins.py so that it no longer globs on '*' to find the files to build. This prevents spurious files (such as EMACS' infamous *~ backup files) from breaking the build.
* glsl: Defer initialization of built-in functions until they're needed.Kenneth Graunke2011-09-231-2/+4
| | | | | | | | | | | | | | | Very simple shaders don't actually use GLSL built-ins. For example: - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_FragColor = vec4(0.0); Both of the shaders used by _mesa_meta_glsl_Clear() also qualify. By waiting to initialize the built-ins until the first time we need to look for a signature, we can avoid the overhead entirely in these cases. Makes piglit run roughly 18% faster (255 vs. 312 seconds). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* texture_builtins.py: Add support for textureSize (txs).Kenneth Graunke2011-08-231-14/+36
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl/generate_builtins.py: Remove regexp to kill pointer addresses.Kenneth Graunke2011-06-141-4/+0
| | | | | | | | | Commit 56ef62d9885f805bbfb2243dc860ff425d5b4d3b "glsl: Generate readable unique names at print time." changed ir_print_visitor to not generate @0x1234567 suffixes except where necessary. So there's no need to manually remove them. Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Add compiler support for ARB_shader_texture_lod.Kenneth Graunke2011-05-091-0/+64
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Tested-by: Marek Olšák <[email protected]>
* glsl: Explicitly specify a type when reading/printing ir_texture.Kenneth Graunke2011-03-141-5/+6
| | | | | | This is necessary for GLSL 1.30+ shadow sampling functions, which return a single float rather than splatting the value to a vec4 based on GL_DEPTH_TEXTURE_MODE.
* texture_builtins.py: Add support for 130-style Shadow sampler variants.Kenneth Graunke2011-03-141-1/+53
|
* glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.Kenneth Graunke2011-02-011-0/+2
| | | | | | This has probably existed since e5e34ab18eeaffa465 or so. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* texture_builtins.py: Fix a warning about mixed tabs/spaces.Kenneth Graunke2011-01-311-1/+1
|
* texture_builtins.py: Generate texture*Offset functions.Kenneth Graunke2011-01-311-5/+80
|
* texture_builtins.py: Generalize the "use_proj" field to support offsets.Kenneth Graunke2011-01-311-52/+57
| | | | | | | | Rather than passing "True", pass a bitfield describing the particular variant's features - either projection or offset. This should make the code a bit more readable ("Proj" instead of "True") and make it easier to support offsets in the future.
* texture_builtins.py: Refactor coordinate dimension calculations.Kenneth Graunke2011-01-311-5/+9
| | | | | For offsets, we'll want the straight sampler dimensionality, without the +1 for array types. Create a new function to do that; refactor.
* glsl: Change texel offsets to a single vector rvalue.Kenneth Graunke2011-01-311-1/+1
| | | | | | | | | | | Having these as actual integer values makes it difficult to implement the texture*Offset built-in functions, since the offset is actually a function parameter (which doesn't have a constant value). The original rationale was that some hardware needs these offset baked into the instruction opcode. However, at least i965 should be able to support non-constant offsets. Others should be able to rely on inlining and constant propagation.
* Convert everything from the talloc API to the ralloc API.Kenneth Graunke2011-01-311-4/+4
|
* generate_builtins.py: Whitespace fixes.Vinson Lee2011-01-141-7/+7
| | | | Also removed unnecessary semicolons.
* generate_builtins.py: Fix builds using Python 2.5.Vinson Lee2011-01-141-0/+2
|
* generate_builtins.py: Add missing import.Vinson Lee2011-01-121-0/+1
| | | | Import sys for sys.exit.
* glsl: Autogenerate builtin_functions.cpp as part of the build process.Kenneth Graunke2011-01-102-40/+9
| | | | | | Python is already necessary for other parts of Mesa, so there's no reason we can't just generate it. This patch updates both make and SCons to do so.
* glsl: Really remove unused "instructions" parameter.Kenneth Graunke2011-01-011-2/+1
| | | | | I forgot about this file, and it didn't show up until I tried to do "make builtins" from a clean build.
* glsl: Remove unused "instructions" parameter.Kenneth Graunke2011-01-011-4/+2
| | | | | | I think was used long ago, when we actually read the builtins into the shader's instruction stream directly, rather than creating a separate shader and linking the two. It doesn't seem to serve any purpose now.