summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_builtin.c
AgeCommit message (Collapse)Author
2010-03-04glsl: Add assert to check input to strcmp.Vinson Lee
2010-03-02glsl: Add assert to check input to strcmp.Vinson Lee
2010-02-27glsl: Assert input to strcmp is not null.Vinson Lee
2010-01-16glsl: Remove unnecessary header from slang_builtin.c.Vinson Lee
2009-09-24glsl: fix missing initializers warningBrian Paul
2009-08-24glsl: Silence gcc uninitialized variable warning.Vinson Lee
2009-08-12glsl: remove duplicate frag input entryBrian Paul
2009-08-12Merge branch 'new-frag-attribs'Brian Paul
This branch introduces new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputs for GLSL gl_FrontFacing and gl_PointCoord. Before, these attributes were packed with the FOG attribute. That made things complicated elsewhere.
2009-08-12glsl: move predefined shader input/output info/code to slang_builtin.cBrian Paul
This is a more logical place for this code. Also add some functions for querying vertex shader input names, types, etc.
2009-07-09glsl: fix incorrect indexing for gl_TextureMatrix[i][j]Brian Paul
The two indexes were mixed up when accessing a row of a matrix in an array of matrices.
2009-07-03mesa/shaders: fix gl_NormalMatrix state parametersKeith Whitwell
gl_NormalMatrix is the inverse transpose of the modelview matrix, but as every matrix here needs to be transposed, we end up with {MODELVIEW_MATRIX, INVERSE}.
2009-04-01glsl: fix texgen state variable tokens in emit_statevars()Brian Paul
This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays. See bug 20986.
2009-02-24glsl: silence warningBrian Paul
2008-12-30mesa: allow variable indexing into the predefined uniform variable arraysBrian Paul
This allows code such as "vec4 a = gl_LightSource[i].ambient;" to work. When a built-in uniform array is indexed with a variable index we need to "unroll" the whole array into the parameter list (aka constant buffer) because we don't know which elements may be accessed at compile-time. In the case of the gl_LightSource array of size [8], we emit 64 state references into the parameter array (8 elements times 8 vec4s per gl_LightSourceParameters struct). Previously, we only allowed constant-indexed references to uniform arrays (such as gl_LightSource[2].position) which resulted in a single state reference being added to the parameter array, not 64. We still optimize this case. Users should be aware that using "gl_LightSource[i].ambient" in their shaders is a bit expensive since state validation will involve updating all 64 light source entries in the parameter list.
2008-11-13mesa: fix accidental regression in GLSL built-in texture matrix lookupBrian Paul
Was broken by commit 9aca9a4b72b2a7b378e50bd88f9c3324d07375ec.
2008-11-13mesa: remove unused/obsolete __NormalMatrixTranspose matrixBrian Paul
2008-11-13mesa: fix bug in GLSL built-in matrix state lookupBrian Paul
2008-07-29mesa: glsl: rework swizzle storage handlingBrian Paul
Build on the heirarchal approach implemented for arrays/structs.
2008-07-29mesa: rework array/struct addressing code.Brian Paul
The slang_ir_storage type now has a pointer to parent storage to represent storage of an array element within an array, or a field within a struct. This fixes some problems related to addressing of fields/elements in non- trivial cases. More work to follow.
2007-11-23Fix parsing of gl_FrontLightModelProduct.sceneColor, don't segfault on ↵Brian
variable array indexes.
2007-07-04Be more consistant with paths in #includes. Eventually, eliminate a bunch ↵Brian
of -I flags.
2007-03-14s/Tranpose/Transpose/Brian
2007-03-08Rework matrix-related code.Brian
GLSL matrices are stored in column-major order while GL_ARB_vertex/fragment_program use row-major. So, need to use STATE_MATRIX_TRANSPOSE for built-in matrices. Unfortunately, this means that the expression M * V isn't very efficient since we need to extract the rows out of M. And that's the typical expression for vertex transformation: gl_ModelViewProjectionMatrix * gl_Position. Solve this inefficiency by looking for M*V expressions and replacing them with V*Transpose(M). Also, add support for GLSL 1.20's MatrixTranspose, Inverse and InverseTranspose matrices.
2007-03-08fix ProjectionMatrix typoBrian
2007-03-08fix gl_TextureMatrix indexingBrian
2007-03-07add missing gl_Point state, fix IR storage bugBrian
2007-03-07s/diffuset/diffuse/Brian
2007-02-23replace GLint with gl_state_indexBrian
2007-02-23Replace slang_ir_node::Target w/ Field. Remove Comment field. Clean-up.Brian
2007-02-22Undo some STATE_POINT/FOG changes. Max length of state token array is now 5.Brian
2007-02-21remove unneeded #includesBrian
2007-02-21fix copy&paste errorsBrian
2007-02-21Reimplement the _slang_alloc_statevar() function.Brian
After several tries at making a table-based system for examining pre-defined uniforms to find statevar indexes, give up and do it the simple way (lots of strcmp() calls). Not terribly elegant, but perfectly functional.
2007-02-21adjustments to STATE_ token layout/format so token[1] is always the array indexBrian
2007-02-21checkpoint overhaul of pre-defined uniform codeBrian
2007-02-20implement support for pre-defined uniform structs (state vars)Brian