Commit graph

37818 commits

Author SHA1 Message Date
Eric Anholt
878740bedf ir_to_mesa: Add codegen for rsq expression operation. 2010-06-24 15:05:20 -07:00
Eric Anholt
8c29a1d84d ir_to_mesa: Add exp/log expression operations. 2010-06-24 15:05:20 -07:00
Eric Anholt
829e0a8eff ir_to_mesa: Add (almost) the rest of the builtin varyings. 2010-06-24 15:05:20 -07:00
Eric Anholt
110d5cc83c ir_to_mesa: Support gl_Position output. 2010-06-24 15:05:20 -07:00
Eric Anholt
8041bce333 ir_to_mesa: Support gl_FragData[] output. 2010-06-24 15:05:20 -07:00
Eric Anholt
48e282d8a2 ir_to_mesa: Support gl_FragData[] output. 2010-06-24 15:05:20 -07:00
Eric Anholt
50ad96ebce ir_to_mesa: Start doing some int support. 2010-06-24 15:05:20 -07:00
Eric Anholt
315c638b8c ir_to_mesa: Fix bugs in swizzle handling for scalar operations.
Looking at a vec2 / float codegen, the writemasks on the RCPs were wrong and
the swizzle on the multiply by the RCP results was wrong.
2010-06-24 15:05:20 -07:00
Eric Anholt
f30100c19c ir_to_mesa: Fix copy'n'paste bug where divide multiplied left by 1/left.
Multiply left by 1/right, please.
2010-06-24 15:05:20 -07:00
Eric Anholt
3d70d1f4d6 ir_to_mesa: Emit more reduced writemasks for ops on small types.
This should help prevent Mesa from having to be smart to give
channel-wise drivers better information.
2010-06-24 15:05:19 -07:00
Eric Anholt
b07cc372c6 ir_to_mesa: Handle swizzles on LHS of assignment (writemasks). 2010-06-24 15:05:19 -07:00
Eric Anholt
12f654c63b ir_to_mesa: Produce multiple scalar ops when required to produce vec4s.
Fixes the code emitted in a test shader for vec2 texcoord / vec2 tex_size.
2010-06-24 15:05:19 -07:00
Eric Anholt
b2ed4dd7b0 ir_to_mesa: Get temps allocated at the right times.
The alloced_vec4/vec4 distinction was an experiment to expose the cost
of temps to the codegen.  But the problem is that the temporary
production rule gets called after the emit rule that was using the
temp.  We could have the args to emit_op be pointers to where the temp
would get allocated later, but that seems overly hard while just
trying to bring this thing up.  Besides, the temps used in expressions
bear only the vaguest relation to how many temps will be used after
register allocation.
2010-06-24 15:05:19 -07:00
Eric Anholt
ae252d3613 ir_to_mesa: Make the first temp index we use 1 to show off bugs.
Regs aren't allocated at the right times yet, so we see TEMP[0] a lot.
2010-06-24 15:05:19 -07:00
Eric Anholt
7aa0b034f7 ir_to_mesa: Fix up the assign rule to use left and right correctly.
The destination of assign is in left, not in the node itself.
2010-06-24 15:05:19 -07:00
Eric Anholt
f14913d4b7 ir_to_mesa: Do my best to explain how the codegen rules work. 2010-06-24 15:05:19 -07:00
Eric Anholt
b7abce770f ir_to_mesa: Print out the ir along with the Mesa IR.
Ideally this would be hooked up by ir_print_visitor dumping into a
string that we could include as prog_instruction->Comment when in
debug mode, and not try keeping ir_instruction trees around after
conversion to Mesa.  The ir_print_visitor isn't set up to do that for
us today.
2010-06-24 15:05:19 -07:00
Eric Anholt
3419583266 ir_to_mesa: Fix up src reg swizzling. 2010-06-24 15:05:19 -07:00
Eric Anholt
c554d7cede ir_to_mesa: Remove dead code from when this was an ARB_fp printer. 2010-06-24 15:05:19 -07:00
Eric Anholt
8197eeee3b ir_to_mesa: Fill in more bits of dest resg. 2010-06-24 15:05:19 -07:00
Eric Anholt
aaee40e107 ir_to_mesa: Print out the resulting program. 2010-06-24 15:05:19 -07:00
Eric Anholt
b5039eff3f Add missing dist file. 2010-06-24 15:05:19 -07:00
Eric Anholt
182b623de3 Ignore the generated codegen files for now.
Later we'll throw them in revision control.
2010-06-24 15:05:19 -07:00
Eric Anholt
84771df82e ir_to_mesa: Start building GLSL IR to Mesa IR conversion.
There are major missing pieces here.  Most operations aren't
supported.  Matrices need to be broken down to vector ops before we
get here.  Scalar operations (RSQ, RCP) are handled incorrectly.
Arrays and structures are not even considered.
2010-06-24 15:05:19 -07:00
Eric Anholt
9290e0dd28 Make inlined function variables auto, not in/out. 2010-06-24 15:05:11 -07:00
Ian Romanick
84341f4b20 Make sure that symbols aren't multiply defined in the same scope.
The assembly parser is already checking this, but we're relying on the
symbol table handling it in glsl2.
2010-06-24 14:56:26 -07:00
Eric Anholt
ebefeb2bdd Attach a pointer to variable names in LIR dumping.
Since variable names are not unique, and we like to make lots of
__retvals and assignment_tmps and a,b,c,d this helps in debugging.
2010-06-24 13:32:35 -07:00
Eric Anholt
9ca0a022e6 Quiet unused arg warning for ir_constant cloning. 2010-06-24 13:32:35 -07:00
Eric Anholt
5f38408833 Move ir_constant cloning alongside the other cloning functions. 2010-06-24 13:32:35 -07:00
Eric Anholt
ae805922b7 Don't forget to add the declaration of our temporary variable for assigns.
Otherwise, dead code elimination gets confused since it relies on
seeing decls.
2010-06-24 13:32:35 -07:00
Eric Anholt
f66ba4f357 ir_function_inlining: Re-add the "s/return/retval =/" functionality.
I ripped it out with the cloning changes yesterday, and should have
tested and noticed that there were now returns all over.
2010-06-24 13:32:35 -07:00
Eric Anholt
1b2bcf7913 Fix variable remapping in function cloning.
It's (ht, data, key) not (ht, key, data).
2010-06-24 13:32:35 -07:00
Marek Olšák
5d1cc93077 r300g: a couple more chipsets do not have HiZ RAM 2010-06-24 22:24:22 +02:00
Corbin Simpson
474dc40fb4 gallium/docs: Vertex data formats.
I'm not sure if I really got it right. This seems like one of those
"Duh, of course it works that way" things, but I'd like the
documentation to be readable by people not acquainted with OGL/D3D.
2010-06-24 07:57:30 -07:00
Corbin Simpson
484bb0ea58 glhd: Add test for logicop enable.
Only for first RT at the moment, as there is no trivial way in galahad
to look at framebuffer state and (sadly) people don't usually calloc
their CSOs, so flags could be wrongly set.

On the other hand, of course, galahad will hopefully encourage more
people to calloc their CSOs. :3
2010-06-24 07:22:29 -07:00
Corbin Simpson
49735d1c6c gallium/docs: Lops override the rest of the blending state when enabled. 2010-06-24 07:22:29 -07:00
Brian Paul
05a18f48e5 gallium/docs: updated remaining semantic label docs 2010-06-24 07:50:29 -06:00
nobled
fd7de146f6 pipe: Add PIPE_OS_HURD
One tiny step toward porting Gallium to the GNU/Hurd kernel
(and fixing Debian bug #585618).

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2010-06-24 06:45:36 -07:00
Corbin Simpson
06a75bd873 gallium/docs: Add lop table.
Was feeling kind of weird without it.
2010-06-24 06:43:50 -07:00
Corbin Simpson
1e10464557 gallium/docs: Slight clarification and formatting for Blend. 2010-06-24 06:43:50 -07:00
Brian Paul
ca12aefdac Merge branch 'shader-file-reorg'
1. Move all GL entrypoint functions and files into src/mesa/main/
This includes the ARB vp/vp, NV vp/fp, ATI fragshader and GLSL bits
that were in src/mesa/shader/

2. Move src/mesa/shader/slang/ to src/mesa/slang/ to reduce the tree depth

3. Rename src/mesa/shader/ to src/mesa/program/ since all the
remaining files are concerned with GPU programs.

4. Misc code refactoring.  In particular, I got rid of most of the
GLSL-related ctx->Driver hook functions.  None of the drivers used
them.

Conflicts:
	src/mesa/drivers/dri/i965/brw_context.c
2010-06-23 22:30:26 -06:00
Marek Olšák
f2122d4724 r300g: remove an XXX comment 2010-06-24 06:15:45 +02:00
Marek Olšák
69adebf594 r300g: move AA registers into the new AA state 2010-06-24 06:10:47 +02:00
Marek Olšák
93bce03b27 r300g: separate the cache flush from the framebuffer state 2010-06-24 06:10:47 +02:00
Marek Olšák
a2f14153cc r300g: reorder and cleanup register writes everywhere 2010-06-24 06:10:47 +02:00
Marek Olšák
6b15a8d2af r300g: add "has HiZ" flag, add ZMask regs 2010-06-24 06:10:47 +02:00
Carl Worth
26bbfb7917 glsl2 main: Switch from realloc to talloc_realloc to construct program source.
This closes 1 leak in the glsl-orangebook-ch06-bump.frag test leaving
4 to go, (all of which are inside hash_table.c).
2010-06-23 19:09:56 -07:00
Carl Worth
b3bd77da56 glsl_type: Add a talloc-based new
And hook it up at the two sites it's called.

Note that with this change we still don't use glsl_type* objects as
talloc contexts, (see things like get_array_instance that accept both
a talloc 'ctx' as well as a glsl_type*). The reason for this is that
the code is still using many instance of glsl_type objects not created
with new.

This closes 3 leaks in the glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 55,618

Leaving only 5 leaks to go.
2010-06-23 19:04:45 -07:00
Carl Worth
12c411504c Close memory leaks in glsl_type (constructor and get_array_instance)
Add a talloc ctx to both get_array_instance and the glsl_type
constructor in order to be able to call talloc_size instead of
malloc.

This fix now makes glsl-orangebook-ch06-bump.frag 99.99% leak free:

	total heap usage: 55,623 allocs, 55,615

Only 8 missing frees now.
2010-06-23 19:00:42 -07:00
Carl Worth
dc5811fd0c Close memory leak in lexer.
Simply call talloc_strdup rather than strdup, (using the talloc_parent
of our 'state' object, (known here as yyextra).

This fix now makes glsl-orangebook-ch06-bump.frag 99.97% leak free:

	total heap usage: 55,623 allocs, 55,609 frees

Only 14 missing frees now.
2010-06-23 19:00:42 -07:00