mesa.git
14 years agoir_constant_expression: Add support for matrix multiplication.
Kenneth Graunke [Tue, 6 Jul 2010 06:19:56 +0000 (23:19 -0700)]
ir_constant_expression: Add support for matrix multiplication.

Also handles matrix/vector and vector/matrix multiplication.

Fixes piglit tests const-matrix-multiply-01.frag,
const-matrix-multiply-02.frag, and const-vec-mat.frag.

14 years agoir_constant_expression: Support scalar * vector and scalar * matrix.
Kenneth Graunke [Tue, 6 Jul 2010 10:01:15 +0000 (03:01 -0700)]
ir_constant_expression: Support scalar * vector and scalar * matrix.

The test here is slightly different since we need to keep matrix
multiplication separate.

Fixes piglit tests const-vec-scalar-03.frag and const-mat-scalar-03.frag.

14 years agoir_constant_expression: Support scalar / vector and scalar / matrix.
Kenneth Graunke [Tue, 6 Jul 2010 09:56:36 +0000 (02:56 -0700)]
ir_constant_expression: Support scalar / vector and scalar / matrix.

Fixes piglit tests const-vec-scalar-04.frag and const-mat-scalar-04.frag.

14 years agoir_constant_expression: Support scalar - vector and scalar - matrix.
Kenneth Graunke [Tue, 6 Jul 2010 09:53:29 +0000 (02:53 -0700)]
ir_constant_expression: Support scalar - vector and scalar - matrix.

Fixes piglit tests const-vec-scalar-02.frag and const-mat-scalar-02.frag.

14 years agoir_constant_expression: Support scalar + vector and scalar + matrix.
Kenneth Graunke [Tue, 6 Jul 2010 09:48:16 +0000 (02:48 -0700)]
ir_constant_expression: Support scalar + vector and scalar + matrix.

Fixes piglit tests const-vec-scalar-01.frag, const-vec-scalar-05.frag,
and const-mat-scalar-01.frag.

14 years agoir_constant_expression: Assert that both operands share a base type.
Kenneth Graunke [Tue, 6 Jul 2010 09:39:57 +0000 (02:39 -0700)]
ir_constant_expression: Assert that both operands share a base type.

14 years agoir_constant_expression: Initialize op[0] and op[1] to NULL.
Kenneth Graunke [Sat, 3 Jul 2010 00:12:23 +0000 (17:12 -0700)]
ir_constant_expression: Initialize op[0] and op[1] to NULL.

This makes it easy to check if there is a second argument.

14 years agoir_constant_expression: Initialize all components of constant data to 0.
Kenneth Graunke [Tue, 6 Jul 2010 05:33:35 +0000 (22:33 -0700)]
ir_constant_expression: Initialize all components of constant data to 0.

This is probably just a good idea, and will come in useful when
implementing things like matrix multiplication.

14 years agoAdd hash table helper functions for using pointers as hash keys
Ian Romanick [Tue, 6 Jul 2010 21:49:14 +0000 (14:49 -0700)]
Add hash table helper functions for using pointers as hash keys

14 years agoMake hashtable.h be C++ friendly
Ian Romanick [Tue, 6 Jul 2010 21:36:54 +0000 (14:36 -0700)]
Make hashtable.h be C++ friendly

14 years agoir_to_mesa: Use the compiler-assigned locations for builtin attrs/varyings.
Eric Anholt [Tue, 6 Jul 2010 19:28:12 +0000 (12:28 -0700)]
ir_to_mesa: Use the compiler-assigned locations for builtin attrs/varyings.

The previous table didn't distinguish gl_Color for the VS and FS, so
we would use the FS's attribute index for the VS and read undefined.
This partially fixes glsl-routing to match its behavior on master.

14 years agoRefresh autogenerated file builtin_function.cpp.
Kenneth Graunke [Sat, 3 Jul 2010 01:20:19 +0000 (18:20 -0700)]
Refresh autogenerated file builtin_function.cpp.

14 years agoglcpp: Add #error support.
Kenneth Graunke [Fri, 2 Jul 2010 22:31:26 +0000 (15:31 -0700)]
glcpp: Add #error support.

14 years agoglsl2: Fix for dead strings being stored in the symbol table.
Kenneth Graunke [Fri, 2 Jul 2010 22:02:57 +0000 (15:02 -0700)]
glsl2: Fix for dead strings being stored in the symbol table.

14 years agoir_to_mesa: Fix uninitalized value.
Kenneth Graunke [Fri, 2 Jul 2010 09:50:40 +0000 (02:50 -0700)]
ir_to_mesa: Fix uninitalized value.

14 years agoglsl2/builtins: Use vector ops in the 130 version of "sign."
Kenneth Graunke [Fri, 2 Jul 2010 09:12:34 +0000 (02:12 -0700)]
glsl2/builtins: Use vector ops in the 130 version of "sign."

14 years agoglsl2/builtins: Use vector ops in "smoothstep."
Kenneth Graunke [Fri, 2 Jul 2010 09:10:01 +0000 (02:10 -0700)]
glsl2/builtins: Use vector ops in "smoothstep."

14 years agoir_to_mesa: Fix up implementation of ir_unop_exp.
Eric Anholt [Sat, 3 Jul 2010 00:02:42 +0000 (17:02 -0700)]
ir_to_mesa: Fix up implementation of ir_unop_exp.

OPCODE_EXP is not to ir_unop_exp what OPCODE_EX2 is to ir_unop_exp2.
It's the weird VP approximation helper opcode.  Just implement it with
OPCODE_POW instead.

Fixes glsl-fs-exp.

14 years agoi965: Add support for the DP2 opcode, which we use for dot(vec2, vec2).
Eric Anholt [Fri, 2 Jul 2010 23:17:50 +0000 (16:17 -0700)]
i965: Add support for the DP2 opcode, which we use for dot(vec2, vec2).

The original glsl compiler would generate a.x * b.x + a.y * b.y, which
we would do mul+mul+add for instead of this mul+mac.

Fixes glsl-fs-dot-vec2.

14 years agoir_to_mesa: Add support for scalar * mat, vec * mat.
Eric Anholt [Fri, 2 Jul 2010 23:10:31 +0000 (16:10 -0700)]
ir_to_mesa: Add support for scalar * mat, vec * mat.

This is not tested by piglit currently.

14 years agoir_to_mesa: Add support for shadow comparison to texture instructions.
Eric Anholt [Fri, 2 Jul 2010 23:09:44 +0000 (16:09 -0700)]
ir_to_mesa: Add support for shadow comparison to texture instructions.

piglit lacks tests for this currently.

14 years agoir_to_mesa: Move projection handling out of ir_tex so txb and txl get it.
Eric Anholt [Fri, 2 Jul 2010 22:37:24 +0000 (15:37 -0700)]
ir_to_mesa: Move projection handling out of ir_tex so txb and txl get it.

Fixes:
glsl-fs-texture2dproj-bias
glsl-fs-texture2dproj-bias-2

14 years agoglsl2: Print the linking info log in the stand-alone compiler
Ian Romanick [Fri, 2 Jul 2010 21:43:01 +0000 (14:43 -0700)]
glsl2: Print the linking info log in the stand-alone compiler

14 years agoir_to_mesa: Add support for projected non-shadow/bias/lod texturing.
Eric Anholt [Fri, 2 Jul 2010 21:49:29 +0000 (14:49 -0700)]
ir_to_mesa: Add support for projected non-shadow/bias/lod texturing.

Fixes:
glsl-fs-texture2dproj
glsl-fs-texture2dproj-2

14 years agoir_to_mesa: Fix sparse swizzling of src regs when a writemask is present.
Eric Anholt [Fri, 2 Jul 2010 21:06:34 +0000 (14:06 -0700)]
ir_to_mesa: Fix sparse swizzling of src regs when a writemask is present.

Fixes glsl-fs-texture2d-masked.

14 years agoir_to_mesa: Don't forget to run the Mesa IR optimization passes.
Eric Anholt [Fri, 2 Jul 2010 18:37:39 +0000 (11:37 -0700)]
ir_to_mesa: Don't forget to run the Mesa IR optimization passes.

With how we generate assignments, the trivial copy propagation in it
is really important, and some drivers will really want the register
allocation, too.

14 years agoglsl2: Add a pass to break ir_binop_div to _mul and _rcp.
Eric Anholt [Fri, 2 Jul 2010 18:27:06 +0000 (11:27 -0700)]
glsl2: Add a pass to break ir_binop_div to _mul and _rcp.

This results in constant folding of a constant divisor.

14 years agoglsl2: Conditionally allow optional extensions to be enabled
Ian Romanick [Wed, 30 Jun 2010 23:42:07 +0000 (16:42 -0700)]
glsl2: Conditionally allow optional extensions to be enabled

The only optional extension currently supported by the compiler is
GL_EXT_texture_array.

14 years agoglsl2: Append _TOK to some parser tokens
Ian Romanick [Wed, 30 Jun 2010 23:40:47 +0000 (16:40 -0700)]
glsl2: Append _TOK to some parser tokens

This prevents conflicts with defines elsewhere in Mesa and allows
including mtypes.h in the compiler.

14 years agoglsl2: Conditionally define preprocessor tokens for optional extensions
Ian Romanick [Wed, 30 Jun 2010 23:27:22 +0000 (16:27 -0700)]
glsl2: Conditionally define preprocessor tokens for optional extensions

The only optional extension currently supported by the compiler is
GL_EXT_texture_array.

14 years agoglsl2: Define preprocessor tokens for extensions
Ian Romanick [Wed, 30 Jun 2010 23:03:19 +0000 (16:03 -0700)]
glsl2: Define preprocessor tokens for extensions

Currently only GL_ARB_draw_buffers and GL_ARB_texture_rectangle are
defined because those extensions are always enabled.  This make
tex_rect-03.frag pass.

14 years agoglsl2: Support AST-to-IR translation of invariant keyword
Ian Romanick [Fri, 2 Jul 2010 03:39:08 +0000 (20:39 -0700)]
glsl2: Support AST-to-IR translation of invariant keyword

14 years agoglsl2: Initialize ast_declarator_list::invariant in constructor
Ian Romanick [Fri, 2 Jul 2010 00:10:11 +0000 (17:10 -0700)]
glsl2: Initialize ast_declarator_list::invariant in constructor

14 years agoglsl2: Don't bounds check unsize array redeclarations
Ian Romanick [Thu, 1 Jul 2010 21:10:19 +0000 (14:10 -0700)]
glsl2: Don't bounds check unsize array redeclarations

This along with several previous commits fix test CorrectUnsizedArray.frag.

14 years agoglsl2: Add gl_MaxTextureCoords
Ian Romanick [Thu, 1 Jul 2010 20:30:50 +0000 (13:30 -0700)]
glsl2: Add gl_MaxTextureCoords

14 years agoglsl2: Default delcaration of gl_TexCoord is unsized
Ian Romanick [Thu, 1 Jul 2010 20:17:54 +0000 (13:17 -0700)]
glsl2: Default delcaration of gl_TexCoord is unsized

14 years agoglsl2: Change order of semaintic checks on variable declarations
Ian Romanick [Thu, 1 Jul 2010 19:46:55 +0000 (12:46 -0700)]
glsl2: Change order of semaintic checks on variable declarations

This will make it easier to support more (valid) kinds of redeclarations.

14 years agoir_to_mesa: Fill in remaining ops, remove default case for expression types.
Eric Anholt [Thu, 1 Jul 2010 18:24:38 +0000 (11:24 -0700)]
ir_to_mesa: Fill in remaining ops, remove default case for expression types.

We should now have support for all the expression types we need for
GLSL 1.20.

14 years agoir_to_mesa: Add support for ir_unop_rcp.
Eric Anholt [Thu, 1 Jul 2010 18:23:02 +0000 (11:23 -0700)]
ir_to_mesa: Add support for ir_unop_rcp.

This isn't used at the moment, but will be soon.

14 years agoglsl2: Update README for what I've been thinking about with expr types work.
Eric Anholt [Thu, 1 Jul 2010 17:32:30 +0000 (10:32 -0700)]
glsl2: Update README for what I've been thinking about with expr types work.

14 years agoglsl2: Add a pass to convert mod(a, b) to b * fract(a/b).
Eric Anholt [Thu, 1 Jul 2010 17:09:58 +0000 (10:09 -0700)]
glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).

This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.

14 years agoglsl2: Remove dead member from dead code visitor.
Eric Anholt [Thu, 1 Jul 2010 17:52:30 +0000 (10:52 -0700)]
glsl2: Remove dead member from dead code visitor.

14 years agoglsl2: Add ir_unop_fract as an expression type.
Eric Anholt [Thu, 1 Jul 2010 17:37:11 +0000 (10:37 -0700)]
glsl2: Add ir_unop_fract as an expression type.

Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.

14 years agoir_to_mesa: Add support for discard instructions.
Eric Anholt [Thu, 1 Jul 2010 00:31:06 +0000 (17:31 -0700)]
ir_to_mesa: Add support for discard instructions.

Fixes glsl-fs-discard-01.

14 years agoglsl2: Don't break sign() down by vector components.
Eric Anholt [Thu, 1 Jul 2010 00:25:09 +0000 (17:25 -0700)]
glsl2: Don't break sign() down by vector components.

14 years agoir_to_mesa: Add support for ir_unop_sign.
Eric Anholt [Thu, 1 Jul 2010 00:06:06 +0000 (17:06 -0700)]
ir_to_mesa: Add support for ir_unop_sign.

Fixes glsl-fs-sign, glsl-vs-sign.

14 years agoi965: Add support for OPCODE_SSG.
Eric Anholt [Thu, 1 Jul 2010 00:05:11 +0000 (17:05 -0700)]
i965: Add support for OPCODE_SSG.

The old compiler didn't use SSG, and instead emitted SGT/SGT/SUB.  We
can do a little better for SSG than we do for the SGT series.

14 years agoir_to_mesa: Add missing no-op type conversions.
Eric Anholt [Wed, 30 Jun 2010 23:23:32 +0000 (16:23 -0700)]
ir_to_mesa: Add missing no-op type conversions.

Fixes glsl-fs-step.

14 years agoglsl2: Fix reversed value of step().
Eric Anholt [Wed, 30 Jun 2010 23:22:52 +0000 (16:22 -0700)]
glsl2: Fix reversed value of step().

It's 0.0 if x < edge, not 1.0.  Partial fix for glsl-fs-step.

14 years agoir_to_mesa: Note which of our expr ops are unsupported 1.30 features.
Eric Anholt [Wed, 30 Jun 2010 23:18:06 +0000 (16:18 -0700)]
ir_to_mesa: Note which of our expr ops are unsupported 1.30 features.

14 years agoglsl2: Fix up the implementation of fract() for vector types.
Eric Anholt [Wed, 30 Jun 2010 22:59:07 +0000 (15:59 -0700)]
glsl2: Fix up the implementation of fract() for vector types.

There's no need to split each vector component out, just do vector ops.

14 years agoir_to_mesa: Initialize the (we never use it) abs field of Mesa src regs.
Eric Anholt [Wed, 30 Jun 2010 22:49:04 +0000 (15:49 -0700)]
ir_to_mesa: Initialize the (we never use it) abs field of Mesa src regs.

14 years agoir_to_mesa: Send the negate field on to Mesa IR.
Eric Anholt [Wed, 30 Jun 2010 22:44:01 +0000 (15:44 -0700)]
ir_to_mesa: Send the negate field on to Mesa IR.

Fixes glsl-fs-neg.

14 years agoir_to_mesa: When generating a swizzle, respect the reg's current swizzle.
Eric Anholt [Wed, 30 Jun 2010 22:26:41 +0000 (15:26 -0700)]
ir_to_mesa: When generating a swizzle, respect the reg's current swizzle.

Fixes depth-tex-modes-glsl.

14 years agoglsl2: Implement AST->HIR support for the "discard" instruction.
Kenneth Graunke [Wed, 30 Jun 2010 21:11:00 +0000 (14:11 -0700)]
glsl2: Implement AST->HIR support for the "discard" instruction.

14 years agoglsl2: Define new ir_discard instruction.
Kenneth Graunke [Wed, 30 Jun 2010 17:47:34 +0000 (10:47 -0700)]
glsl2: Define new ir_discard instruction.

14 years agoir_to_mesa: Support gl_FragDepth.
Eric Anholt [Wed, 30 Jun 2010 21:55:45 +0000 (14:55 -0700)]
ir_to_mesa: Support gl_FragDepth.

Fixes glsl-bug-22603.

14 years agoglsl2: Allow a fragment shader to not write a color.
Eric Anholt [Wed, 30 Jun 2010 21:51:50 +0000 (14:51 -0700)]
glsl2: Allow a fragment shader to not write a color.

I can't find any text justifying this check, and it caused a
reasonable-looking shader in glsl-bug-22603 (which writes only
gl_FragDepth) to fail.

14 years agomesa: Don't look in unallocatd param slots for parameter values.
Eric Anholt [Wed, 30 Jun 2010 21:28:38 +0000 (14:28 -0700)]
mesa: Don't look in unallocatd param slots for parameter values.

glsl-derivs would add 40.0, 0.0, and 1.0 in order.  When we went
looking for 0.0, we'd find it in the second slot of the param, and use
it, but param->Size would still be 1.  When we went to add 1.0 and
didn't find it, we'd put allocate it to that second slot and the 0.0
would actualy end up being 1.0.

Fixes glsl-derivs, glsl-deriv-varyings.

14 years agoir_to_mesa: Fix the indexing of attributes in the program's Attributes.
Eric Anholt [Wed, 30 Jun 2010 21:01:43 +0000 (14:01 -0700)]
ir_to_mesa: Fix the indexing of attributes in the program's Attributes.

This fixes GetAttribLocation returning VERT_ATTRIB_GENERIC1 instead of 1,
caught by glsl-dlist-getattriblocation.

14 years agoglsl2: Fix storing of dead memory in the symbol table.
Kenneth Graunke [Wed, 30 Jun 2010 18:57:43 +0000 (11:57 -0700)]
glsl2: Fix storing of dead memory in the symbol table.

decl->identifier is part of the AST, so it doesn't live very long.
Instead, add var->name which is owned by var.

14 years agoglsl2: Preprocessed source doesn't need to live past compile time.
Kenneth Graunke [Tue, 29 Jun 2010 18:31:04 +0000 (11:31 -0700)]
glsl2: Preprocessed source doesn't need to live past compile time.

14 years agoglsl2: Create new talloc contexts the "right" way.
Kenneth Graunke [Fri, 25 Jun 2010 20:36:14 +0000 (13:36 -0700)]
glsl2: Create new talloc contexts the "right" way.

14 years agoglsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.
Kenneth Graunke [Fri, 25 Jun 2010 20:14:37 +0000 (13:14 -0700)]
glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.

_mesa_glsl_parse_state should be the parent for all temporary allocation
done while compiling a shader.  glsl_shader should only be used as the
parent for the shader's final IR---the _result_ of compilation.

Since many IR instructions may be added or discarded during optimization
passes, IR should not ever be allocated to glsl_shader directly.

Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g.

This also removes a ton of talloc_parent calls, which may help performance.

14 years agoglsl2: Steal the live IR and free the rest of the junk.
Kenneth Graunke [Fri, 25 Jun 2010 21:10:01 +0000 (14:10 -0700)]
glsl2: Steal the live IR and free the rest of the junk.

14 years agolinker: Don't dynamically allocate slots for linked shaders
Ian Romanick [Wed, 30 Jun 2010 00:58:43 +0000 (17:58 -0700)]
linker: Don't dynamically allocate slots for linked shaders

The can be at most one shader per stage.  There are currently only two
stages.  There is zero reason to dynamically size this array.

14 years agoir_to_mesa: Tell Mesa about our choices for vertex attribute locations.
Eric Anholt [Wed, 30 Jun 2010 01:23:05 +0000 (18:23 -0700)]
ir_to_mesa: Tell Mesa about our choices for vertex attribute locations.

14 years agolinker: Don't automatically allocate VERT_ATTRIB_GENERIC0
Ian Romanick [Wed, 30 Jun 2010 01:58:20 +0000 (18:58 -0700)]
linker: Don't automatically allocate VERT_ATTRIB_GENERIC0

14 years agoglsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.
Eric Anholt [Wed, 30 Jun 2010 18:49:17 +0000 (11:49 -0700)]
glsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.

This avoids more allocation and shuffling of data around.

14 years agoglsl2: Make function names and variable names be children of the node.
Eric Anholt [Wed, 30 Jun 2010 18:51:54 +0000 (11:51 -0700)]
glsl2: Make function names and variable names be children of the node.

This avoids losing their memory when the parser state is freed.

14 years agoglsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.
Eric Anholt [Wed, 30 Jun 2010 18:05:43 +0000 (11:05 -0700)]
glsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.

This saves recompiling at link time.  gl_shader->ir is made a pointer
so that we don't have to bring exec_list into mtypes.h.

14 years agoir_to_mesa: Add support for ir_unop_abs.
Eric Anholt [Tue, 29 Jun 2010 23:39:38 +0000 (16:39 -0700)]
ir_to_mesa: Add support for ir_unop_abs.

14 years agoir_to_mesa: Add support for dFdx, dFdy.
Eric Anholt [Tue, 29 Jun 2010 23:36:42 +0000 (16:36 -0700)]
ir_to_mesa: Add support for dFdx, dFdy.

14 years agoir_to_mesa: Start adding support for texture instructions.
Eric Anholt [Tue, 29 Jun 2010 21:16:11 +0000 (14:16 -0700)]
ir_to_mesa: Start adding support for texture instructions.

Fixes:
glsl-fs-bug25902
glsl-fs-sampler-numbering
glsl-lod-bias

14 years agoglsl2: Keep the same number of components in implicit conversions.
Kenneth Graunke [Tue, 29 Jun 2010 22:59:27 +0000 (15:59 -0700)]
glsl2: Keep the same number of components in implicit conversions.

Fixes piglit test glsl-implicit-conversion-01.

14 years agoglsl2: Make gl_MaxDrawBuffers available in the vertex shader
Ian Romanick [Tue, 29 Jun 2010 22:29:56 +0000 (15:29 -0700)]
glsl2: Make gl_MaxDrawBuffers available in the vertex shader

14 years agoglsl2: Make gl_MaxDrawBuffers available in the fragment shader
Ian Romanick [Tue, 29 Jun 2010 22:19:11 +0000 (15:19 -0700)]
glsl2: Make gl_MaxDrawBuffers available in the fragment shader

14 years agoglsl2: Make gl_FragData be available in GLSL 1.10 too
Ian Romanick [Tue, 29 Jun 2010 22:10:09 +0000 (15:10 -0700)]
glsl2: Make gl_FragData be available in GLSL 1.10 too

14 years agoglsl2: Pass MaxDrawBuffers from core Mesa into the GLSL compiler
Ian Romanick [Tue, 29 Jun 2010 21:21:05 +0000 (14:21 -0700)]
glsl2: Pass MaxDrawBuffers from core Mesa into the GLSL compiler

14 years agoglsl_type: Add _mesa_glsl_release_types to release all type related storage
Ian Romanick [Mon, 28 Jun 2010 20:17:18 +0000 (13:17 -0700)]
glsl_type: Add _mesa_glsl_release_types to release all type related storage

14 years agoglsl_type: All glsl_type objects live in their own talloc context
Ian Romanick [Mon, 28 Jun 2010 19:19:52 +0000 (12:19 -0700)]
glsl_type: All glsl_type objects live in their own talloc context

14 years agoglsl_type: Record type constructors are private
Ian Romanick [Mon, 28 Jun 2010 18:57:38 +0000 (11:57 -0700)]
glsl_type: Record type constructors are private

14 years agoglsl_type: Add get_record_instance method
Ian Romanick [Mon, 28 Jun 2010 18:54:57 +0000 (11:54 -0700)]
glsl_type: Add get_record_instance method

14 years agoglsl_type: Vector, matrix, and sampler type constructors are private
Ian Romanick [Mon, 28 Jun 2010 18:09:40 +0000 (11:09 -0700)]
glsl_type: Vector, matrix, and sampler type constructors are private

14 years agoglsl_type: Make all static objects be class private
Ian Romanick [Mon, 28 Jun 2010 18:01:57 +0000 (11:01 -0700)]
glsl_type: Make all static objects be class private

14 years agoglsl2: Use talloc_strdup when generating constructor temporary names
Ian Romanick [Mon, 28 Jun 2010 20:22:55 +0000 (13:22 -0700)]
glsl2: Use talloc_strdup when generating constructor temporary names

14 years agoglsl_type: Remove vector and matrix constructor generators
Ian Romanick [Sat, 26 Jun 2010 00:58:16 +0000 (17:58 -0700)]
glsl_type: Remove vector and matrix constructor generators

All scalar, vector, and matrix constructors are generated in-line
during AST-to-HIR translation.  There is no longer any need to
generate function versions of the constructors.

14 years agoglsl2: Don't flatten constructor parameters to scalars
Ian Romanick [Sat, 26 Jun 2010 00:36:17 +0000 (17:36 -0700)]
glsl2: Don't flatten constructor parameters to scalars

Now that all scalar, vector, and matrix constructors are emitted
in-line, the parameters to these constructors should not be flattened
to a pile of scalars.  Instead, the functions that emit the in-line
constructor bodies can directly write the parameters to the correct
locations in the objects being constructed.

14 years agoglsl2: Always emit matrix constructors inline
Ian Romanick [Fri, 25 Jun 2010 23:10:43 +0000 (16:10 -0700)]
glsl2: Always emit matrix constructors inline

14 years agoglsl2: Always emit vector constructors inline
Ian Romanick [Wed, 23 Jun 2010 22:19:40 +0000 (15:19 -0700)]
glsl2: Always emit vector constructors inline

14 years agoir_swizzle: Add new constructor, refactor constructors
Ian Romanick [Fri, 25 Jun 2010 22:25:27 +0000 (15:25 -0700)]
ir_swizzle: Add new constructor, refactor constructors

Adds a new constructor that takes an array of component values.  Refactors
the meat of the two constructors to an init_mask method.

14 years agoglsl2: Update TODO.
Kenneth Graunke [Tue, 29 Jun 2010 17:02:01 +0000 (10:02 -0700)]
glsl2: Update TODO.

14 years agoglsl2: Check for non-void functions that don't have a return statement.
Kenneth Graunke [Tue, 29 Jun 2010 16:59:40 +0000 (09:59 -0700)]
glsl2: Check for non-void functions that don't have a return statement.

This doesn't do any control flow analysis to ensure that the return
statements are actually reached.

Fixes piglit tests function5.frag and function-07.vert.

14 years agoglsl2: Reject return types with qualifiers.
Kenneth Graunke [Tue, 29 Jun 2010 07:48:10 +0000 (00:48 -0700)]
glsl2: Reject return types with qualifiers.

Fixes piglit test return-qualifier.frag.

14 years agoglsl2: Add a method for querying if an AST type has any qualifiers.
Kenneth Graunke [Tue, 29 Jun 2010 07:47:44 +0000 (00:47 -0700)]
glsl2: Add a method for querying if an AST type has any qualifiers.

14 years agoglsl2: Check that returned expressions match the function return type.
Kenneth Graunke [Tue, 29 Jun 2010 06:38:04 +0000 (23:38 -0700)]
glsl2: Check that returned expressions match the function return type.

From my reading of the specification, implicit conversions are not
allowed.  ATI seems to agree, though nVidia allows it without warning.

14 years agoglsl2: Invoke preprocessor before calling the compiler proper
Ian Romanick [Tue, 29 Jun 2010 17:02:36 +0000 (10:02 -0700)]
glsl2: Invoke preprocessor before calling the compiler proper

14 years agoir_to_mesa: Actually initialize the undef register for scalar_op1.
Eric Anholt [Mon, 28 Jun 2010 22:02:51 +0000 (15:02 -0700)]
ir_to_mesa: Actually initialize the undef register for scalar_op1.

Fixes glsl-sin, glsl-cos on 965, where we rely on unused src arguments
in the VS having a file of PROGRAM_UNDEFINED.

14 years agoir_to_mesa: Support user-defined varyings using the linker's locations.
Eric Anholt [Mon, 28 Jun 2010 21:47:43 +0000 (14:47 -0700)]
ir_to_mesa: Support user-defined varyings using the linker's locations.

Fixes glsl-reload-source.

14 years agoir_to_mesa: Actually add the header file for the interface.
Eric Anholt [Mon, 28 Jun 2010 20:45:43 +0000 (13:45 -0700)]
ir_to_mesa: Actually add the header file for the interface.