Eric Anholt
9acf618f24
glsl2: Remove dead member from dead code visitor.
2010-07-01 11:07:22 -07:00
Eric Anholt
d925c91730
glsl2: Add ir_unop_fract as an expression type.
...
Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.
2010-07-01 11:07:22 -07:00
Brian Paul
17c176eb73
llvmpipe: silence pointer type warnings
2010-07-01 09:15:31 -06:00
José Fonseca
8d93f360c5
gallivm: Support 4 x unorm8 in lp_build_fetch_rgba_aos().
...
Uses code and ideas from Brian Paul.
2010-07-01 15:02:17 +01:00
José Fonseca
b919bb7f61
gallivm: Allow to conversions to/from registers of different sizes.
...
Allow for example to convert from 4 x float32 to 4 x unorm8 and vice versa.
Uses code and ideas from Brian Paul.
2010-07-01 15:02:15 +01:00
José Fonseca
a70ec096aa
gallivm: Support extended swizzles in lp_build_swizzle1_aos().
...
And rename to lp_build_swizzle_aos().
2010-07-01 15:02:12 +01:00
José Fonseca
e277d5c1f6
gallivm: Setup a global optimization pass.
...
Modules are still free to setup their own optimization passes, but for the
normal case it should not be necessary.
2010-07-01 15:02:10 +01:00
José Fonseca
83ced5a918
llvmpipe: Remove lp_build_swizzle2_aos().
...
Unnecessary special case.
2010-07-01 15:02:04 +01:00
Eric Anholt
5e4dd061d1
ir_to_mesa: Add support for discard instructions.
...
Fixes glsl-fs-discard-01.
2010-06-30 17:31:06 -07:00
Eric Anholt
f5b3b2a01a
glsl2: Don't break sign() down by vector components.
2010-06-30 17:29:12 -07:00
Eric Anholt
3acd92a91f
ir_to_mesa: Add support for ir_unop_sign.
...
Fixes glsl-fs-sign, glsl-vs-sign.
2010-06-30 17:29:12 -07:00
Eric Anholt
e558786a3e
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.
2010-06-30 17:29:09 -07:00
Eric Anholt
d6ebe9b16b
ir_to_mesa: Add missing no-op type conversions.
...
Fixes glsl-fs-step.
2010-06-30 16:23:32 -07:00
Eric Anholt
02d615306e
glsl2: Fix reversed value of step().
...
It's 0.0 if x < edge, not 1.0. Partial fix for glsl-fs-step.
2010-06-30 16:23:15 -07:00
Eric Anholt
e64a4aaacb
ir_to_mesa: Note which of our expr ops are unsupported 1.30 features.
2010-06-30 16:18:06 -07:00
Eric Anholt
4e16a7b526
glsl2: Fix up the implementation of fract() for vector types.
...
There's no need to split each vector component out, just do vector ops.
2010-06-30 15:59:07 -07:00
Eric Anholt
285ff93819
ir_to_mesa: Initialize the (we never use it) abs field of Mesa src regs.
2010-06-30 15:49:04 -07:00
Eric Anholt
ea6b34cce4
ir_to_mesa: Send the negate field on to Mesa IR.
...
Fixes glsl-fs-neg.
2010-06-30 15:47:11 -07:00
Eric Anholt
698b844443
ir_to_mesa: When generating a swizzle, respect the reg's current swizzle.
...
Fixes depth-tex-modes-glsl.
2010-06-30 15:30:00 -07:00
Kenneth Graunke
77049a702a
glsl2: Implement AST->HIR support for the "discard" instruction.
2010-06-30 14:54:58 -07:00
Kenneth Graunke
16efab1c4d
glsl2: Define new ir_discard instruction.
2010-06-30 14:54:58 -07:00
Eric Anholt
88c20c46b8
ir_to_mesa: Support gl_FragDepth.
...
Fixes glsl-bug-22603.
2010-06-30 14:55:45 -07:00
Eric Anholt
97eba76b8c
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.
2010-06-30 14:51:50 -07:00
Eric Anholt
3e2127b9de
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.
2010-06-30 14:46:06 -07:00
Eric Anholt
c64da87611
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.
2010-06-30 14:44:14 -07:00
Kenneth Graunke
c7f4ff193a
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.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
629198b96a
glsl2: Preprocessed source doesn't need to live past compile time.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
c6099a65f8
glsl2: Create new talloc contexts the "right" way.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
953ff1283d
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.
2010-06-30 13:52:24 -07:00
Kenneth Graunke
116f1d4f95
glsl2: Steal the live IR and free the rest of the junk.
2010-06-30 13:52:24 -07:00
Brian Paul
fb06b543a5
llvmpipe: another null pointer check
2010-06-30 14:05:45 -06:00
Brian Paul
2b3e1ad731
llvmpipe: use dummy tile when out of memory
2010-06-30 14:05:45 -06:00
Ian Romanick
ef5f194831
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.
2010-06-30 12:20:44 -07:00
Eric Anholt
edcb9c2b06
ir_to_mesa: Tell Mesa about our choices for vertex attribute locations.
2010-06-30 12:02:31 -07:00
Ian Romanick
982e3798d8
linker: Don't automatically allocate VERT_ATTRIB_GENERIC0
2010-06-30 12:02:11 -07:00
Eric Anholt
849e18153c
glsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.
...
This avoids more allocation and shuffling of data around.
2010-06-30 12:01:42 -07:00
Eric Anholt
0eda9ae0a6
glsl2: Make function names and variable names be children of the node.
...
This avoids losing their memory when the parser state is freed.
2010-06-30 11:52:40 -07:00
Eric Anholt
16b68b1952
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.
2010-06-30 11:30:26 -07:00
Brian Paul
effd33071e
llvmpipe: added new lp_memory.[ch] files
...
Functions for using dummy tiles when we detect OOM conditions.
2010-06-30 12:00:22 -06:00
Brian Paul
87d2c77ed3
draw: fix out of memory handling in polygon stipple stage
2010-06-30 11:46:17 -06:00
Neil Roberts
75acb896c6
glu: Fix some compiler warnings in libtess
...
When compiled with the more aggressive compiler warnings such as
-Wshadow and -Wempty-body the libtess code gives a lot more
warnings. This fixes the following issues:
* The 'Swap' macro tries to combine multiple statements into one and
then consume the trailing semicolon by using if(1){/*...*/}else.
This gives warnings because the else part ends up with an empty
statement. It also seems a bit dangerous because if the semicolon
were missed then it would still be valid syntax but it would just
ignore the following statement. This patch replaces it with the more
common idiom do { /*...*/ } while(0).
* 'free' was being used as a local variable name but this shadows the
global function. This has been renamed to 'free_handle'
* TRUE and FALSE were being unconditionally defined. Although this
isn't currently a problem it seems better to guard them with #ifndef
because it's quite common for them to be defined in other headers.
https://bugs.freedesktop.org/show_bug.cgi?id=28845
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-06-30 07:59:39 -06:00
Chia-I Wu
a8815b754d
egl: Update MaxSize when a dynamic array is grown.
2010-06-30 18:52:00 +08:00
Chia-I Wu
98ebc8165c
egl: Make _eglUnloadDrivers no-op on Windows.
...
Windows unloads DLLs before atexit. Make _eglUnloadDrivers no-op on
Windows for now.
2010-06-30 18:32:48 +08:00
Chia-I Wu
c5bc0a8d66
st/egl: Manually free configs on terminate.
...
The configs should be FREE()ed, not free()ed. We cannot rely on
_eglCleanupDisplay here.
2010-06-30 18:32:48 +08:00
Chia-I Wu
8b0c6c4a8d
egl: Store screens in a dynamic array.
2010-06-30 18:32:48 +08:00
Chia-I Wu
6717a313f2
egl: Store configs in a dynamic array.
2010-06-30 18:32:48 +08:00
Chia-I Wu
106466783f
egl: Add dynamic array.
...
Dynamic arrays will be used to store configs and screens of a display.
2010-06-30 18:32:48 +08:00
Chia-I Wu
2d8e70fcd5
st/vega: Match MALLOC/FREE for vg_shader.
...
A vg_shader is destroyed with FREE.
2010-06-30 18:32:48 +08:00
José Fonseca
a2311400fe
llvmpipe: Add a new scene state to describe scenes which only have state changes.
...
It's a rare condition, but it may happen if all primitives are
clipped/culled.
For now we just do a no-op rasterization, but we could bypass it.
2010-06-30 11:10:33 +01:00
José Fonseca
4ca3e0d84b
llvmpipe: Don't reset the bin when there's a zsbuf bound.
...
The previous rendering may have secondary effects on the zsbuf.
Fixes the missing tiles on gearbox.
2010-06-30 10:19:50 +01:00