Commit Graph

37029 Commits

Author SHA1 Message Date
Kenneth Graunke
d6792a7f7c ir_constant_expression: Add support for "any" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
aca7e95222 ir_constant_expression: Add support for "all" builtin. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
8b1680acc3 ir_constant_expression: Implement builtins that wrap an expression.
These builtin functions are represented by ir_expression_operations, so
we can just create one of those and ask for its value.
2010-07-28 15:46:26 -07:00
Kenneth Graunke
38cb1b273f ir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth.
These always return zero (the derivative of a constant).
2010-07-28 15:46:26 -07:00
Kenneth Graunke
46d91615a2 ast_function: Set constant_value on return value temporaries in 1.20+. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
bafd89fa0f ir_constant_expression: Stub out support for constant builtins. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
f914915d8e ir_constant_expression: Use Mesa's MIN2/MAX2 instead of our own. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
f7b94f32a2 ir_algebraic: Use ir_constant::zero. 2010-07-28 15:46:26 -07:00
Kenneth Graunke
ee9a3a51b6 glsl2: Add new ir_constant::zero static method.
This conveniently creates a zero value of whatever type you want.
2010-07-28 15:46:26 -07:00
Eric Anholt
0c7b37c836 glsl2: Add the define for ARB_fragment_coord_conventions when present.
Fixes:
glsl-arb-fragment-coord-conventions-define
2010-07-28 15:00:29 -07:00
Eric Anholt
4a962170d7 glsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.
Fixes:
glsl-arb-fragment-coord-conventions
2010-07-28 15:00:09 -07:00
Ian Romanick
8d8469eb2a glsl2: Perform some semantic checking of ARB_fcc layout qualifiers
The rest cannot be handled until built-in variables (i.e.,
gl_FragCoord) can be redeclared to add qualifiers.
2010-07-28 14:16:12 -07:00
Ian Romanick
f50f06552e glsl2: Parser support for GL_ARB_fragment_coord_conventions 2010-07-28 14:14:38 -07:00
Eric Anholt
b706283c79 glsl2: Fail linking where the FS reads a varying that the VS doesn't write.
Fixes:
glsl1-varying read but not written
glsl1-varying var mismatch
2010-07-28 14:04:54 -07:00
Eric Anholt
a6c7606ab6 glsl2: Unmark unwritten varyings as varying.
This fixes an assertion failure in ir_to_mesa, and the varying won't
take up varying space.
2010-07-28 14:04:54 -07:00
Carl Worth
667173e362 glcpp: Add generated source files.
This is now consistent with other usage of flex/bison througout mesa,
(which is that these generated files are added to source control so
that the build system does not require external tools like flex/bison
for non-developers).
2010-07-28 13:48:32 -07:00
Carl Worth
f8a04b3877 glsl: Ignore glsl_compiler and glsl_parser.output files.
These are generated files where we can do the sane thing, and keep
them out of version control.
2010-07-28 13:48:32 -07:00
Carl Worth
e8a8f0f278 glsl: Add generated files from flex/bison.
The mesa build environment does not (currently) accept external
dependencies such as flex and bison. The compromise is to commit the
generated output files, (in spite of the pain that comes from having
generated files under version control).
2010-07-28 13:48:32 -07:00
Carl Worth
279cc22dbc glcpp: Add expected output for a recently-added test.
I simply forgot to add this file when adding the test case originally.
2010-07-28 13:48:32 -07:00
Eric Anholt
dc27e73569 ir_to_mesa: Add remaining state variable (builtin uniforms) support.
Fixes:
glsl1-GL state variable reference (diffuse product)
glsl1-GL state variable reference (gl_FrontMaterial.ambient)
glsl1-GL state variable reference (gl_LightSource[0].diffuse)
glsl1-GL state variable reference (point attenuation)
glsl1-GL state variable reference (point size)
glsl1-linear fog
2010-07-28 12:34:20 -07:00
Eric Anholt
85b5dba593 glsl2: Add the remaining builtin uniforms. 2010-07-28 12:34:08 -07:00
Eric Anholt
73df636e04 glsl2: Size builtin arrays according to the context constants.
Cleans up some of the FINISHMEs in this file.
2010-07-28 11:16:19 -07:00
Carl Worth
efef950f39 glcpp: Explicitly expect 0 shift/reduce conflicts.
The "%expect 0" construct will make bison emit an error if any future
changes to the grammar introduce shift/reduce conflicts, (without also
increasing the number after "%expect").
2010-07-28 11:10:52 -07:00
Carl Worth
2233d10442 glcpp: Remove 2 shift/reduce conflicts from the grammar.
Since we have productions to turn "defined FOO" and "defined ( FOO )"
into a conditional_token we don't need to list DEFINED as an operator
as well. Doing so just introduces the shift/reduce ambiguity with no
benefit.
2010-07-28 11:07:46 -07:00
Eric Anholt
f9b0e5e322 glsl2: When stealing var->constant_value, steal its children as well.
Fixes:
glsl1-GLSL 1.20 uniform array constructor
2010-07-27 15:25:07 -07:00
Eric Anholt
9a670c2e9b ir_to_mesa: Provide a restricted type size to _mesa_add_uniform.
Fixes:
glsl-uniform-out-of-bounds.
2010-07-27 15:10:38 -07:00
Eric Anholt
59c45e9e6c glsl2: Actually use the linked dead code eliminator.
I managed to revert the change from unlinked at some point while
cleaning up the changes.  glsl-fs-raytrace-bug27060 drops from 389
instructions to 370.
2010-07-27 14:34:53 -07:00
Eric Anholt
54f583a206 glsl2: Don't dereference a NULL var in CE handling during a compile error.
If an undeclared variable was dereferenced in an expression that
needed constant expression handling, we would walk off a null ir->var
pointer.

Fixes:
glsl1-TIntermediate::addUnaryMath
2010-07-27 12:10:50 -07:00
Eric Anholt
20c074ae28 ir_to_mesa: Add support for array constants.
Fixes:
glsl1-GLSL 1.20 array constructor 1
glsl1-GLSL 1.20 array constructor 2
glsl1-GLSL 1.20 array.length()
glsl1-GLSL 1.20 const array constructor 1
glsl1-GLSL 1.20 const array constructor 2
2010-07-27 12:02:11 -07:00
Eric Anholt
bf6ad0ab3d glsl2: Use ir_dead_code's linked version after linking.
glsl-fs-raytrace-bug27060 goes from 485 Mesa IR instructions to 389
before Mesa IR optimization.
2010-07-27 11:49:27 -07:00
Eric Anholt
5532c4ca69 glsl2: Fix the linked version of ir_dead_code.
If we don't walk into functions, we won't see any usage of variables
in the functions.
2010-07-27 11:46:06 -07:00
Eric Anholt
66d4c65ee2 glsl2: Make the dead code handler make its own talloc context.
This way, we don't need to pass in a parse state, and the context
doesn't grow with the number of passes through optimization.
2010-07-27 11:46:05 -07:00
Eric Anholt
8bbdf6e7cd mesa: Allow large temporary indices coming into the temporary reg allocator.
This gets glsl-vs-raytrace, glsl-fs-raytrace running on the new
compiler.
2010-07-27 11:45:27 -07:00
Eric Anholt
85cd64ee17 glsl2: Talloc type names.
Otherwise, we end up losing structure names after compile time, and
dumping IR often ends up reporting some other mysterious string.
2010-07-27 11:14:59 -07:00
Eric Anholt
9a770ee49f ir_to_mesa: Set the swizzle on constant struct src regs.
MESA_GLSL=nopt now produces believable output for glsl-fs-raytrace.
2010-07-27 10:41:01 -07:00
Eric Anholt
fdbaca931a ir_to_mesa: Fix stray "break" that broke functions of >1 argument. 2010-07-27 10:08:38 -07:00
Eric Anholt
832aad989e glsl2: Add optimization pass for algebraic simplifications.
This cleans up the assembly output of almost all the non-logic tests
glsl-algebraic-*.  glsl-algebraic-pow-two needs love (basically,
flattening to a temporary and squaring it).
2010-07-27 09:43:52 -07:00
Eric Anholt
5533c6e380 ir_validate: Check the types of expression operations. 2010-07-27 09:43:52 -07:00
Eric Anholt
6a1401eb88 glsl2: Fix missing visit_continue return in ir_validate. 2010-07-27 00:18:57 -07:00
Eric Anholt
576d01ad8c ir_to_mesa: Fix up handling of void function returns.
void functions have a type of glsl_type::void_type, not a null type.
2010-07-26 19:41:39 -07:00
Eric Anholt
c91809e1e4 ir_to_mesa: Actually allocate the right size for constant matrix temps. 2010-07-26 19:41:23 -07:00
Eric Anholt
5b6890a388 ir_to_mesa: Add support for structure constants.
Fixes:
TPPStreamCompiler::assignOperands
2010-07-26 19:40:47 -07:00
Eric Anholt
fbaca31352 glsl2: Also steal the constant components of aggregate-typed ir_constants. 2010-07-26 19:30:19 -07:00
Kenneth Graunke
eb2cc4f1b1 glsl2: Steal ir_variable's constant_value field.
Fixes a link-time crash in glsl-vs-cross-3.
2010-07-26 19:09:10 -07:00
Eric Anholt
e2130d4e39 glsl2: Remove old .gitignore file from when we were out of tree. 2010-07-26 17:54:35 -07:00
Eric Anholt
afe125e0a1 Merge remote branch 'origin/master' into glsl2
This pulls in multiple i965 driver fixes which will help ensure better
testing coverage during development, and also gets past the conflicts
of the src/mesa/shader -> src/mesa/program move.

Conflicts:
	src/mesa/Makefile
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderobj.h
2010-07-26 17:53:27 -07:00
Eric Anholt
d64343f1ae ir_to_mesa: Flag when we use the address reg.
Hardware backends will get angry otherwise.
2010-07-26 17:45:37 -07:00
Kristian Høgsberg
5403ca79b2 glx: Remove function prototypes no longer necessary 2010-07-26 17:37:59 -04:00
Eric Anholt
2621100458 i965: Fix reversed naming of the operations in compute-to-mrf optimization.
Also fix up comments, so that the difference between the two passes is
clarified.
2010-07-26 13:08:25 -07:00
Eric Anholt
b3ea15f12b i965: Clean up a few magic numbers to use brw_defines.h defs. 2010-07-26 13:08:25 -07:00