summaryrefslogtreecommitdiff
path: root/src/glsl/standalone_scaffolding.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-01-20glsl: Add extension infrastructure for ARB_viewport_arrayIan Romanick1-0/+1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-09mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.Paul Berry1-7/+7
These are replaced with ctx->Const.Program[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In patches to follow, this will allow us to replace a lot of ad-hoc logic with a variable index into the array. With the exception of the changes to mtypes.h, this patch was generated entirely by the command: find src -type f '(' -iname '*.c' -o -iname '*.cpp' -o -iname '*.py' \ -o -iname '*.y' ')' -print0 | xargs -0 sed -i \ -e 's/Const\.VertexProgram/Const.Program[MESA_SHADER_VERTEX]/g' \ -e 's/Const\.GeometryProgram/Const.Program[MESA_SHADER_GEOMETRY]/g' \ -e 's/Const\.FragmentProgram/Const.Program[MESA_SHADER_FRAGMENT]/g' Suggested-by: Brian Paul <brianp@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-08mesa: Store gl_shader_stage enum in gl_shader objects.Paul Berry1-0/+1
Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-08mesa: Clean up nomenclature for pipeline stages.Paul Berry1-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 <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>
2013-11-01mesa: Add infrastructure for GL_ARB_sample_shadingAnuj Phogat1-0/+1
This patch implements the common support code required for the GL_ARB_sample_shading extension. V2: Move GL_ARB_sample_shading to ARB extension list. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Ken Graunke <kenneth@whitecape.org>
2013-10-07glsl_compiler: Enable any extension that any Mesa driver enablesIan Romanick1-1/+8
The only GLSL extension that is not enabled is AMD_vertex_shader_layer. I think the standalone-compiler could enable this (as shading language support is complete), but no driver enables it. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07glsl_compiler: Sort extensions by nameIan Romanick1-8/+11
Makes it a little easier to see which ones are missing. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-05glsl: add plumbing for GL_ARB_texture_query_levelsChris Forbes1-0/+1
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-03glsl: add texture gather changesMaxence Le Dore1-0/+1
V2 [Chris Forbes]: - Add new pattern, fixup parameter reading. V3: Rebase onto new builtins machinery Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-19glsl: Set VertexProgram.MaxOutputComponents and ↵Ian Romanick1-0/+2
FragmentProgram.MaxInputComponents in standalone scaffolding Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-05-12glsl: Initialize ctx->ShaderCompilerOptions in standalone scaffolding.Kenneth Graunke1-0/+12
This code is copied from _mesa_init_shader_state(). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-05-11mesa: move max texture image unit constants to gl_program_constantsMarek Olšák1-2/+2
Const.MaxTextureImageUnits -> Const.FragmentProgram.MaxTextureImageUnits Const.MaxVertexTextureImageUnits -> Const.VertexProgram.MaxTextureImageUnits etc. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-05-06mesa: Add infrastructure for ARB_gpu_shader5.Matt Turner1-0/+1
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-03-29glsl: Implement ARB_texture_query_lodDave Airlie1-0/+1
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 <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-03-05mesa: Report ARB_debug_output for both shader errors and warnings.Eric Anholt1-1/+1
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 <jordan.l.justen@intel.com>
2013-03-02glsl: add support for ARB_texture_multisampleChris Forbes1-0/+1
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 <chrisf@ijw.co.nz> [V2] Reviewed-by: Eric Anholt <eric@anholt.net> [V2] Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25glsl: Add infrastructure for ARB_shading_language_packingMatt Turner1-0/+1
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-24glsl/standalone_scaffolding: Add stub for _mesa_warning()Chad Versace1-0/+18
A subsequent patch will add mesa/main/imports.c as a dependency to the compiler, which in turn requires that _mesa_warning() be defined. The real definition of _mesa_warning() is in mesa/main/errors.c, but to pull that file into the standalone scaffolding would require transitively pulling in the dispatch tables. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Paul Berry <stereotype441@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-06mesa: Add ARB_ES3_compatibility flag.Paul Berry1-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 <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Carl Worth <cworth@cworth.org>
2012-11-09glsl: add ARB_texture_cube_map_array support (v2)Dave Airlie1-0/+1
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 <kenneth@whitecape.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-10-31mesa: don't always enable OES_standard_derivativesMarek Olšák1-0/+1
For Intel, expose it only if gen >= 4. For Gallium, expose it only if PIPE_CAP_SM3 is advertised. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-06-07glsl: Scaffolding for ARB_shader_bit_encoding.Olivier Galibert1-0/+1
That adds support for activating the extension. It doesn't actually *do* anything yet, of course. Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-02glsl: report errors via GL_ARB_debug_outputDylan Noblesmith1-0/+6
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03glsl: add support for GL_OES_EGL_image_externalChia-I Wu1-0/+1
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 <brianp@vmware.com> Acked-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-04mesa: Remove ARB_draw_buffers extension enable flagIan Romanick1-1/+0
All drivers in Mesa have supported this extension for eons. This extension is an optional features in desktop OpenGL (via GL_ARB_draw_buffers) and OpenGL ES 2.x (via GL_NV_draw_buffers). The extension is not usable in OpenGL ES 1.x. There is no glDrawBuffers* entry point in OpenGL ES 1.x contexts, and glGet*v generate errors when MAX_DRAW_BUFFERS or DRAW_BUFFERi is queried. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-09glsl: Silence several "warning: unused parameter"Ian Romanick1-0/+1
2011-08-24glsl: Make sure that Extensions.dummy_true is set to trueIan Romanick1-0/+2
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-07-22glsl: Move functions into standalone_scaffolding.cpp for later reuse.Paul Berry1-0/+91
This patch moves the following functions from main.cpp (the main cpp file for the standalone executable that is used to create the built-in functions) to standalone_scaffolding.cpp, so that they can be re-used in other standalone executables: - initialize_context()* - _mesa_new_shader() - _mesa_reference_shader() *initialize_context contained some code that was specific to main.cpp, so it was split into two functions: initialize_context() (which remains in main.cpp), and initialize_context_from_defaults() (which is in standalone_scaffolding.cpp).