summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/program_parse.y
Commit message (Collapse)AuthorAgeFilesLines
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-2767/+0
|
* shaders: Don't lose the param binding swizzle for single params.Eric Anholt2010-06-021-1/+1
| | | | | | | | | Multiple item params are OK because we don't allow swizzles for them (in case you do array access to hit their elements, for example). For singles, though, using the swizzle can cut down on storage, we do want to allow a swizzled use of another param. Fixes OGLC texRect.c.
* mesa: Eliminate multiple va_list usage.José Fonseca2010-04-241-3/+4
| | | | | | | va_list is a mutable iterator. When passed to a function it will likely point to somewhere else. This fixes segmentation fault in glean vertProg1 on Ubuntu 9.10.
* mesa: Restore comment too.José Fonseca2010-04-181-1/+1
|
* mesa: fix snprintf() typoBrian Paul2010-02-191-1/+1
|
* mesa: restore _mesa_snprintf() - it's needed for WindowsBrian Paul2010-02-191-5/+5
| | | | This reverts part of commit 298be2b028263b2c343a707662c6fbfa18293cb2
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-3/+3
|
* Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg2010-02-191-11/+11
|
* Remove _mesa_memcpy in favor of plain memcpy.Kenneth Graunke2010-02-191-1/+1
| | | | This may break the SUNOS4 build, but it's no longer relevant.
* mesa: Add "shader/" path to #include statements in shader parser/lexer sourcesAlan Coopersmith2010-01-221-8/+8
| | | | | | | | Signed-off-by: Alan Coopersmith <[email protected]> Note sure why the compiler's -I paths aren't doing the job, but this is OK. Signed-off-by: Brian Paul <[email protected]>
* ARB prog parser: fix parameter binding typeBrian Paul2010-01-051-2/+5
| | | | | | | | | | References to program local and enviroment parameters are put into the unified program parameters list as PROGRAM_STATE_VAR entries which point into the local or environment arrays. So the param_binding_type field should be PROGRAM_STATE_VAR. This fixes the piglit vpfp-generic vp-arl-env-array.vpfp and vp-arl-local-array.vpfp test failures.
* ARB prog parser: add allowSwizzle param to initialize_symbol_from_const()Brian Paul2010-01-051-8/+14
| | | | | | | | We need to disable constant consolidation when building an array of constants which might be indexed indirectly. Fixes regression in piglit vpfp-generic vp-arl-constant-array.vpfp test caused by earlier constant consolidation patch.
* ARB prog parser: Silence unused variable warnings.Vinson Lee2010-01-011-0/+4
|
* ARB prog parser: use _mesa_add_unnamed_constant() to use fewer constant slotsBrian Paul2009-12-291-14/+52
| | | | | | | | | This function will search the constant parameters in an effort to re-use constant slots. For example, {1,2,3,4} and {4,1,1,2} can be stored in one constant slot and accessed with different swizzles. The swizzle info must be propogated though the parsing code in a few places. Fixes Piglit "vpfp-generic tests/shaders/generic/big-param.vpfp" failure.
* Merge branch 'outputswritten64'Ian Romanick2009-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add a GLbitfield64 type and several macros to operate on 64-bit fields. The OutputsWritten field of gl_program is changed to use that type. This results in a fair amount of fallout in drivers that use programs. No changes are strictly necessary at this point as all bits used are below the 32-bit boundary. Fairly soon several bits will be added for clip distances written by a vertex shader. This will cause several bits used for varyings to be pushed above the 32-bit boundary. This will affect any drivers that support GLSL. At this point, only the i965 driver has been modified to support this eventuality. I did this as a "squash" merge. There were several places through the outputswritten64 branch where things were broken. I foresee this causing difficulties later for bisecting. The history is still available in the branch. Conflicts: src/mesa/drivers/dri/i965/brw_wm.h
* Merge branch 'mesa_7_6_branch'Ian Romanick2009-11-061-18/+31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should fix the memory leaks in the assembly parser without the regressions. The conflicts in program_lexer.l were related to changes in returning strings between the branches (always return IDENTIFIER vs. returing either IDENTIFIER or USED_IDENTIFIER). The conflicts in program_parse.y were related to two changes in master One change prints a variable name in an error message. The other change adds outputVarSize to the OUTPUT_statement rule. The cause the position of the IDENTIFIER to change from $2 to $3. Conflicts: src/mesa/shader/lex.yy.c src/mesa/shader/program_lexer.l src/mesa/shader/program_parse.tab.c src/mesa/shader/program_parse.y
| * ARB prog parser: Release old program string in ↵Ian Romanick2009-11-061-4/+0
| | | | | | | | | | | | | | | | | | _mesa_parse_arb_{fragment,vertex}_program The program structure passed to _mesa_parse_arb_program is just a place holder. The stings that actually need to be released are only known to the functions calling _mesa_parse_arb_program, so they should be freed there.
| * ARB prog parser: Release strings returned from the lexer that don't need to ↵Ian Romanick2009-11-061-1/+27
| | | | | | | | be kept
| * Revert "ARB prog parser: Fix epic memory leak in lexer / parser interface"Ian Romanick2009-11-061-13/+4
| | | | | | | | | | | | | | | | This reverts commit 93dae6761bc90bbd43b450d2673620ec189b2c7a. This change was completely broken when the parser uses multiple strings in a single production. It would be nice if bug fixes could initially land somewhere other than the stable branch.
* | ARB prog parser: include variable name in error textBrian Paul2009-11-041-2/+3
| |
* | ARB prog parser: new set_src_reg(), set_dst_reg() helpersBrian Paul2009-10-301-28/+55
| | | | | | | | These functions do sanity checks on the register file and index.
* | Merge branch 'mesa_7_6_branch'Brian Paul2009-10-281-4/+17
|\| | | | | | | | | | | | | Conflicts: src/mesa/shader/lex.yy.c src/mesa/shader/program_lexer.l
| * ARB prog parser: Fix epic memory leak in lexer / parser interfaceIan Romanick2009-10-271-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Anything that matched IDENTIFIER was strdup'ed and returned to the parser. However, almost every case of IDENTIFIER in the parser just dropped the returned string on the floor. Every swizzle string, every option string, every use of a variable, etc. leaked memory. Create a temporary buffer in the parser state (string_dumpster and dumpster_size). Return strings from the lexer to the parser in the buffer. Grow the buffer as needed. When the parser needs to keep a string (i.e., delcaring a new variable), let it make a copy then. The only leak that valgrind now detects is /occasionally/ the copy of the program string in gl_program::String is leaked. I'm not seeing how. :(
| * ARB prog parser: Don't leak program stringIan Romanick2009-10-271-0/+4
| | | | | | | | | | The program string is kept in the program object. On the second call into glProgramStringARB the previous kept string would be leaked.
* | Merge remote branch 'origin/mesa_7_6_branch'Eric Anholt2009-10-231-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/mesa/drivers/dri/intel/intel_fbo.c src/mesa/drivers/dri/intel/intel_mipmap_tree.c src/mesa/drivers/dri/intel/intel_mipmap_tree.h src/mesa/drivers/dri/intel/intel_tex_copy.c src/mesa/drivers/dri/intel/intel_tex_image.c
| * ARB prog parser: Fix parameter array size comparisonIan Romanick2009-10-221-1/+1
| | | | | | | | | | | | | | | | Array indexes are invalid when >= the maximum, but array sizes are only in valid when > the maximum. This prevented programs from declaring a single maximum size array. See the piglit vp-max-array test.
* | Merge branch 'asm-shader-rework-2'Ian Romanick2009-09-251-55/+333
|\ \ | | | | | | | | | | | | Conflicts: src/mesa/shader/program_parse.tab.c
| * | Merge branch 'master' into asm-shader-rework-2Ian Romanick2009-09-101-9/+8
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/mesa/shader/lex.yy.c src/mesa/shader/program_parse.tab.c src/mesa/shader/program_parse.tab.h
| * | NV fp parser: Add support for condition codesIan Romanick2009-09-101-3/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conditional write masks and the condition-code based KIL instruction are all supported. The specific behavior of KIL in the following shader may or may not match the behavior of other implementations: !!ARBfp1.0 TEMP GT; MOVC GT, fragment.texcoord[0]; KIL GT.x; END Should be it interpreted as 'KIL srcReg' or as 'KIL ccTest'? The current parser will interpret it as 'KIL srcReg'.
| * | ARB prog parser: Differentiate between used and unused names in the lexerIan Romanick2009-09-101-9/+14
| | | | | | | | | | | | | | | The lexer will return IDENTIFIER only when the name does not have an associated symbol. Otherwise USED_IDENTIFIER is returned.
| * | NV fp parser: Support instruction and TEMP / OUTPUT sizesIan Romanick2009-09-041-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for declaring TEMP and OUTPUT variables as 'LONG' or 'SHORT' precision. The precision specifiers are parsed, but they are currently ignored. Some support for this may be added in the future, but neither Intel hardware nor, as far as I'm aware, Radeon hardware support multiple precisions. Also adds support for instruction precision ('X', 'H', and 'R') suffixes and instruction condition code output ('C') suffix. This results in a fairly major change to the lexer. Instructions are matched with all the possible suffix strings. The suffix string are then carved off by a context (i.e., which program mode and options are set) aware parser that converts the suffixes to bits in prog_instruction. This could have been handled in the same way _SAT was originally handled in the lexer, but it would have resulted in a very large lexer with lots of opportunity for cut-and-paste errors.
| * | ARB prog parser: Add new constructor for asm_instructionIan Romanick2009-09-041-39/+72
| | | | | | | | | | | | | | | The new constructor copies fields from the prog_instruction that the parser expects the lexer to set.
| * | NV fp parser: Add support for absolute value operator on instruction operandsIan Romanick2009-09-031-6/+45
| | |
| * | NV fp parser: Support new scalar constant behaviorIan Romanick2009-09-031-0/+17
| | | | | | | | | | | | | | | | | | ARBfp requires scalar constants have a '.x' suffix, but NVfp_option does not. This shows up with instructions that require a scalar parameter (e.g., COS).
| * | NV fp parser: Parse TXD instructionIan Romanick2009-09-011-1/+47
| | |
| * | NV fp lexer: Add new opcodesIan Romanick2009-08-311-1/+1
| | |
* | | ARB prog parser: more detailed error message for out of bounds ADDR offsetsBrian Paul2009-09-151-4/+8
| |/ |/|
* | ARB prog: replace 'unsigned' with 'gl_state_index'Brian Paul2009-09-041-3/+2
| | | | | | | | Fixes compilation warnings with MSVC.
* | ARB prog: rename POINT, SIZE to POINT_TOK, SIZE_TOKBrian Paul2009-09-041-4/+4
| | | | | | | | | | Fixes symbol collisions with typedefs in Microsoft headers. Perhaps we should prefix/suffix all the lexer tokens to avoid this.
* | ARB prog parser: Fix handling of stateOptModMatNumIan Romanick2009-09-011-2/+2
|/ | | | | | The optional array index should clearly be enclosed in square brackets. This helps the oglconform test vp_binding.c get a bit farther, but it still fails.
* ARB prog parser: use correct context limitsBrian Paul2009-08-241-6/+6
|
* ARB prog parser: Revert part of previous change to constant parsingIan Romanick2009-08-201-8/+8
| | | | | | The commit "ARP prog parser: Implement the spec, not what makes sense" broke the parsing of scalar constants. This commit reverts that part of that commit. Now vp_swizzle.c passes.
* ARB prog parser: Add support for RGBA components to SWZ instruction in fpIan Romanick2009-07-301-13/+72
|
* ARB prog parser: Prevent NULL ptr deref for KIL instructionIan Romanick2009-07-301-1/+9
| | | | | The KIL instruction doesn't have a destination register, so dereferencing dst in asm_instruction_ctor would cause a segfault.
* ARP prog parser: Implement the spec, not what makes senseIan Romanick2009-07-291-9/+18
|
* ARB prog parser: Get program limits from the contextIan Romanick2009-07-291-24/+3
| | | | | Some debug code from the older stand-alone version of the assembler was hanging around and needed to go.
* ARB prog parser: Finish implementing fp state.depth.rangeIan Romanick2009-07-291-1/+8
|
* Indentation fixes.Ian Romanick2009-07-291-8/+8
|
* ARB prog parser: Set NumAttributes based on the number of attribs readIan Romanick2009-07-291-0/+1
|
* ARB prog parser: Set component negation mask for SWZ instructionIan Romanick2009-07-281-0/+1
|