Brian Paul
848835a3d8
mesa: added _mesa_clone_vertex/fragment_program()
...
To reduce casting elsewhere...
2010-02-14 21:57:14 -07:00
Brian Paul
a2ddb3d209
mesa: change _mesa_find_free_register() to find multiple free regs
...
Before, _mesa_find_free_register() would scan the given shader to
find a free/unused register of the given type. But subsequent calls
would return the same register again. This caused a failure in the
_mesa_remove_output_reads() function which sometimes needs several
free temps.
Now use a new function which build a vector of 'used' flags and another
function which searches that vector for an unused register starting at
a position that's incremented for each call.
Fixes fd.o bug 26317. Note that a regression test for this has been
added to the glean/glsl1 test.
(cherry picked from commit e0d01c9d7f46ccd531f8dd1a04c5ac067200ef1e)
2010-02-01 18:00:12 -07:00
Brian Paul
ec6ad7ba3c
mesa: added _mesa_postprocess_program() to aid shader debugging
2009-06-17 09:58:29 -06:00
Brian Paul
bbd287103d
mesa: prefix a bunch of #include lines with "main/".
...
This is another step toward removing a whole bunch of -I flags from
the cc commands. Still need to address driver code...
2008-09-18 12:26:54 -06:00
Brian Paul
b7eea9a1ce
mesa: refactor: move _mesa_Bind/Gen/DeleteProgram() to arbprogram.c
...
No API-level functions now in program.c.
2008-07-29 17:19:25 -06:00
Nicolai Haehnle
d8d086c20b
r500: Add "Not quite SSA" and dead code elimination pass
...
In addition, this pass fixes non-native swizzles.
2008-07-12 09:36:02 +02:00
Brian Paul
0c78c766e4
fixes to _mesa_combine_programs(), from gallium-0.1
2008-05-18 15:46:26 -06:00
Brian Paul
6ca948a303
added _mesa_combine_parameter_lists()
...
cherry-picked from gallium-0.1
2008-05-14 12:53:03 -06:00
Brian Paul
19ad9cf774
mesa: added _mesa_insert_instructions()
...
Also, use new _mesa_free_instructions() in a few places.
cherry-picked from gallium-0.1
2008-05-14 12:39:41 -06:00
Brian
df43fb661b
implement full reference counting for vertex/fragment programs
...
Use _mesa_reference_vert/fragprog() wherever we assign program pointers.
Fixes a memory corruption bug found with glean/api2 test.
2008-05-06 23:08:51 -06:00
Brian
4b654d41da
For _mesa_share_state(), update the context's references to the new share group's objects (Shane Blackett)
2007-08-23 08:53:43 +01:00
Brian
942ee02590
move GL_MESA_program_debug funcs to prog_debug.c
2007-02-09 15:40:00 -07:00
Brian
cc6a141dc1
Remove some moved extern decls.
2006-12-14 15:47:34 -07:00
Brian
0560d81ce9
Move many functions into new files.
2006-12-14 15:01:28 -07:00
Brian
b2a3a8554a
New functions for cloning programs and parameter lists.
2006-12-14 13:56:58 -07:00
Brian
fe1d01cb39
Checkpoint of work for new GLSL compiler back-end. Lots of assorted changes.
2006-12-13 14:54:47 -07:00
Brian Paul
a4806c994e
add STATE_INTERNAL_DRIVER, etc (Rune Petersen)
2006-11-17 15:23:32 +00:00
Brian Paul
0c6723aee5
Add a size parameter to _mesa_add_unnamed_constant() and
...
_mesa_add_named_constant() to indicate vector size (1, 2, 3 or 4).
Always 4 for now...
2006-11-15 23:38:02 +00:00
Brian Paul
699a33ea77
Add new _mesa_lookup_parameter_constant() to search for a GLfloat4 constant
...
in a parameter list.
Use it in _mesa_add_named_constant() and _mesa_add_unnamed_constant() to
avoid duplication of identical constants.
2006-11-15 23:19:52 +00:00
Brian Paul
f49c0d0dfb
Rename _mesa_IsProgram() to _mesa_IsProgramARB() to avoid collision with the
...
OpenGL 2.0 function of the same name.
2006-11-02 16:20:29 +00:00
Keith Whitwell
187f2cfb4a
Add a new internal program parameter value STATE_TEXRECT_SCALE which
...
provides 1/width and 1/height of the active texture, useful for
implementing ARB_texture_rectangle support on hardware which only
supports ARB_npot-style texturing.
2006-09-20 14:30:22 +00:00
Keith Whitwell
5658810660
Export _mesa_print_alu_instruction() to allow drivers to roll their
...
own debug code for programs with driver-private opcodes.
Remove redundant loop in _mesa_num_inst_src_regs().
2006-09-20 12:57:54 +00:00
Brian Paul
9983a27cbe
added _mesa_alloc_instructions() utility function
2006-08-25 15:13:25 +00:00
Brian Paul
3b9b8de9b0
Added _mesa_realloc_instructions() utility function.
...
Fixed/updated comments for parameter list functions.
2006-08-24 21:57:36 +00:00
Brian Paul
4d12a05e6c
Added _mesa_lookup_program() and _mesa_lookup_bufferobj() functions to avoid
...
a lot of casting elsewhere.
Use _mesa_lookup_texture() in tdfx driver, use _mesa_lookup_bufferobj() in r300
driver.
2006-08-23 23:10:14 +00:00
Brian Paul
122629f279
Some structure renaming. Prefix vertex/fragment-related structs with
...
"gl_" to match other structs.
2006-07-20 16:49:57 +00:00
Brian Paul
65a51c0d62
Roll _mesa_free_parameters() into calling function (the only caller).
...
Replace assert(0) with _mesa_warning().
Use new _mesa_align_realloc() function.
New comments, clean-ups.
2006-05-24 03:30:31 +00:00
Brian Paul
0c1cbd5805
use GLbitfield for StateFlags, improved comments
2006-05-24 03:01:58 +00:00
Keith Whitwell
ec1ffd9f25
track state flags which might invalidate parameter lists
2005-11-22 12:12:17 +00:00
Brian Paul
63d683091f
No longer derive 'ati_fragment_shader' from 'program' class. Only the
...
program->Id and program->RefCount fields were used and ATI fragment shaders
didn't have too much in common with ARB/NV vertex/fragment programs anyway.
2005-11-19 16:43:04 +00:00
Brian Paul
de99760bf3
Move stuff common to vertex/fragment_program into the base class, including:
...
Instructions, InputsRead, OutputsWritten, and Parameters.
Also, added debug functions: _mesa_print_instruction(),
_mesa_print_program_parameters() and revamp _mesa_print_program().
2005-11-12 17:53:14 +00:00
Brian Paul
30d6a4bffa
consolidate vertex/fragment program printing into _mesa_print_program()
2005-11-05 20:18:18 +00:00
Brian Paul
fd4395b8d1
don't need MAKE_SWIZZLE() macro
2005-11-05 03:02:28 +00:00
Brian Paul
613e1ad5d5
Replace parameter_type enum in program.[ch], use register_file enums instead.
2005-11-05 02:15:21 +00:00
Brian Paul
1624162b0c
added a const, clean-up
2005-11-03 02:26:47 +00:00
Keith Whitwell
f29f2fc294
reduce the use of malloc and strdup for parameter lists
2005-05-10 13:56:23 +00:00
Keith Whitwell
7c26b61f93
Reduce the size of mesa's internal fragment and vertex program
...
representations by switching to packed structures for registers and
instructions.
2005-04-21 14:46:57 +00:00
Brian Paul
cdb6541634
prototype _mesa_init_ati_fragment_shader()
2005-01-11 15:56:47 +00:00
Brian Paul
9ca8392484
fix LoadProgramNV regression when I had fixed the RefCount bug
2004-10-02 15:16:59 +00:00
Brian Paul
253204f9f0
More updates for Doxygen.
2004-09-10 00:45:12 +00:00
Brian Paul
21841f0ae5
fix some memory leaks (bug #1002030 )
2004-08-14 14:28:11 +00:00
Michal Krol
2861e737e8
Moved from src/mesa/main
2004-03-29 11:09:34 +00:00