Commit Graph

146 Commits

Author SHA1 Message Date
Kenneth Graunke
26f8fad145 Remove _mesa_memset in favor of plain memset.
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-19 09:18:57 -05:00
Kenneth Graunke
c7ac486261 Remove _mesa_memcpy in favor of plain memcpy.
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-19 09:18:36 -05:00
Brian Paul
b947b1d433 mesa: copy frag coord layout fields too 2010-02-13 13:51:38 -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
20fbb24b67 mesa: fix double->float assignment warnings, int/uint comparison warnings
Reported by Karl Schultz.
2010-01-27 17:04:30 -07:00
Brian Paul
b605f4ff11 Merge branch 'mesa_7_6_branch' into mesa_7_7_branch 2009-12-11 09:22:00 -07:00
Brian Paul
5076a4f53a mesa: check dst reg in _mesa_find_free_register()
If a register was only being used as a destination (as will happen when
generated condition-codes) we missed its use.  So we'd errantly return
a register index that was really in-use, not free.

Fixes bug 25579.
2009-12-11 09:16:27 -07:00
Brian Paul
e33ea11c14 mesa: remove: unused gl_vertex_program::TnlData field 2009-09-24 19:34:19 -06:00
Nicolai Hähnle
736e1ae42f r300: Fix handling of NV_vertex_program parameters
The handling is a bit inefficient, unfortunately, but I don't want to make
any intrusive changes for Mesa 7.6.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-09-21 12:56:16 +02:00
Brian Paul
dd528f0ec1 mesa: additional instruction field size assertions 2009-08-26 12:02:24 -06:00
Brian Paul
516d20fd26 mesa: silence warning 2009-06-17 09:58:29 -06:00
Brian Paul
ec6ad7ba3c mesa: added _mesa_postprocess_program() to aid shader debugging 2009-06-17 09:58:29 -06:00
Brian Paul
c5af2ed60f mesa: add switch case for GL_VERTEX_STATE_PROGRAM_NV in _mesa_new_program()
Fixes bug seen in progs/tests/vptest1.c
2009-04-18 10:08:54 -06:00
Brian Paul
8d475822e6 mesa: rename, reorder FRAG_RESULT_x tokens
s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/
s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/
Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it.
Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc).
2009-02-28 11:49:46 -07:00
Brian Paul
5b2f8dc013 mesa: increase MAX_UNIFORMS to 1024 (of vec4 type)
Old limit was 256.  Note that no arrays are declared to this size.
The only place we have to be careful about raising this limit is the
prog_src/dst_register Index bitfields.  These have been bumped up too.

Added assertions to check we don't exceed the bitfield in the future too.
2009-02-18 13:15:13 -07:00
Brian Paul
5273a5f0d7 mesa: fix off-by-one bug in _mesa_delete_instructions() 2009-01-09 11:16:40 +00:00
Keith Whitwell
3a3801c143 Merge commit 'origin/master' into gallium-0.2
Conflicts:

	src/mesa/glapi/descrip.mms
	src/mesa/shader/grammar/descrip.mms
2008-10-10 15:26:28 +01:00
Keith Whitwell
d7f1cb5b5a Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:

	src/gallium/auxiliary/gallivm/instructionssoa.cpp
	src/gallium/auxiliary/gallivm/soabuiltins.c
	src/gallium/auxiliary/rtasm/rtasm_x86sse.c
	src/gallium/auxiliary/rtasm/rtasm_x86sse.h
	src/mesa/main/texenvprogram.c
	src/mesa/shader/arbprogparse.c
	src/mesa/shader/prog_statevars.c
	src/mesa/state_tracker/st_draw.c
	src/mesa/vbo/vbo_exec_draw.c
2008-10-10 15:23:36 +01:00
Brian Paul
5c4bd76cb6 mesa: in _mesa_combine_programs() take new STATE_CURRENT_ATTRIB color into account
Commit 1680ef8696 changed the texenv program
to get color from a state register instead of a constant-valued vertex
attribute.  This broke program concatenation (so glDraw/CopyPixels broke).
Now check if the second program get's color from a constant register and
handle that case appropriately.
2008-10-08 14:02:24 -06:00
Brian Paul
4bc39c58eb mesa: fix assertion in _mesa_reference_program() 2008-09-26 07:40:45 -06:00
Keith Whitwell
dace236c5f Merge branch 'master' into gallium-0.2
Conflicts:

	src/mesa/glapi/glapi.h
	src/mesa/main/api_exec.c
	src/mesa/main/attrib.c
	src/mesa/main/clear.c
	src/mesa/main/context.c
	src/mesa/main/mfeatures.h
	src/mesa/main/mipmap.c
	src/mesa/main/mipmap.h
	src/mesa/main/readpix.c
	src/mesa/main/sources
	src/mesa/main/state.c
	src/mesa/main/texformat.c
	src/mesa/main/texparam.c
	src/mesa/main/texstate.c
	src/mesa/vbo/vbo_context.c
	src/mesa/x86/common_x86_asm.S
2008-09-21 22:30:55 -07:00
Brian Paul
93c90d34d1 mesa: set point state
(cherry picked from commit af3d9dba56)
2008-09-21 22:13:57 -07:00
José Fonseca
457d7218b8 mesa: Use appropriate unsigned/signed, float/integer types. 2008-09-21 22:13:56 -07:00
Keith Whitwell
32ef6e7583 mesa: move fixed function vertex program builder from tnl to core mesa
Also unify caching of fragment and vertex programs in shader/prog_cache.c`

Brought across from gallium-0.2
2008-09-21 09:46:00 -07: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
Keith Whitwell
0397b2bb41 Merge branch 'gallium-0.1' into gallium-0.2
A first attempt at moving gallium onto a branch directly off master...

It will be interesting to see how much work this takes to get running.

Have resolved the conflicts semi-arbitarily, not compiled or tested.

Conflicts:

	.gitignore
	Makefile
	configs/config.mgw
	configs/darwin
	configs/darwin-x86ppc
	configs/default
	configs/freebsd-dri
	configs/linux-dri
	configs/linux-dri-xcb
	configs/linux-fbdev
	configs/linux-static
	configs/linux-x86-64-static
	configs/linux-x86-static
	doxygen/Makefile
	include/GL/gl.h
	progs/demos/Makefile
	progs/demos/descrip.mms
	progs/demos/texenv.c
	progs/egl/.gitignore
	progs/egl/Makefile
	progs/glsl/.gitignore
	progs/glsl/Makefile
	progs/glsl/convolutions.c
	progs/samples/Makefile.mgw
	progs/tests/.gitignore
	progs/trivial/.gitignore
	progs/trivial/point-param.c
	progs/trivial/tri.c
	progs/xdemos/.gitignore
	progs/xdemos/glthreads.c
	src/egl/drivers/demo/Makefile
	src/egl/drivers/dri/Makefile
	src/egl/main/Makefile
	src/glu/Makefile
	src/glu/sgi/Makefile
	src/glu/sgi/Makefile.mgw
	src/glut/glx/Makefile.mgw
	src/glut/os2/WarpWin.cpp
	src/glut/os2/glut_cindex.cpp
	src/glut/os2/glut_gamemode.cpp
	src/glut/os2/glut_win.cpp
	src/glut/os2/glut_winmisc.cpp
	src/glut/os2/os2_glx.cpp
	src/glut/os2/os2_menu.cpp
	src/glut/os2/os2_winproc.cpp
	src/glw/Makefile
	src/glx/x11/dri_glx.c
	src/glx/x11/glxext.c
	src/mesa/Makefile
	src/mesa/Makefile.mgw
	src/mesa/descrip.mms
	src/mesa/drivers/beos/Makefile
	src/mesa/drivers/common/descrip.mms
	src/mesa/drivers/common/driverfuncs.c
	src/mesa/drivers/directfb/Makefile
	src/mesa/drivers/dri/Makefile.template
	src/mesa/drivers/dri/common/dri_bufmgr.c
	src/mesa/drivers/dri/common/dri_bufmgr.h
	src/mesa/drivers/dri/common/dri_util.c
	src/mesa/drivers/dri/common/extension_helper.h
	src/mesa/drivers/dri/common/mmio.h
	src/mesa/drivers/dri/common/utils.c
	src/mesa/drivers/dri/common/utils.h
	src/mesa/drivers/dri/glcore/Makefile
	src/mesa/drivers/dri/i810/i810screen.c
	src/mesa/drivers/dri/i915/intel_ioctl.c
	src/mesa/drivers/dri/i915/intel_ioctl.h
	src/mesa/drivers/dri/i915/intel_screen.c
	src/mesa/drivers/dri/i915/server/i830_common.h
	src/mesa/drivers/dri/i915/server/i830_dri.h
	src/mesa/drivers/dri/i965/intel_screen.c
	src/mesa/drivers/dri/i965/server/i830_common.h
	src/mesa/drivers/dri/i965/server/i830_dri.h
	src/mesa/drivers/dri/mach64/mach64_screen.c
	src/mesa/drivers/dri/nouveau/nouveau_context.h
	src/mesa/drivers/dri/nouveau/nouveau_fifo.c
	src/mesa/drivers/dri/nouveau/nouveau_fifo.h
	src/mesa/drivers/dri/nouveau/nouveau_screen.c
	src/mesa/drivers/dri/nouveau/nouveau_screen.h
	src/mesa/drivers/dri/r128/r128_tex.h
	src/mesa/drivers/dri/savage/savageioctl.h
	src/mesa/drivers/fbdev/Makefile
	src/mesa/drivers/osmesa/Makefile
	src/mesa/drivers/osmesa/descrip.mms
	src/mesa/drivers/x11/Makefile
	src/mesa/drivers/x11/descrip.mms
	src/mesa/drivers/x11/xm_dd.c
	src/mesa/glapi/glapi.c
	src/mesa/glapi/glthread.c
	src/mesa/main/api_validate.c
	src/mesa/main/attrib.c
	src/mesa/main/bufferobj.c
	src/mesa/main/bufferobj.h
	src/mesa/main/buffers.c
	src/mesa/main/config.h
	src/mesa/main/context.c
	src/mesa/main/descrip.mms
	src/mesa/main/drawpix.c
	src/mesa/main/enums.c
	src/mesa/main/fbobject.c
	src/mesa/main/glheader.h
	src/mesa/main/imports.c
	src/mesa/main/mipmap.c
	src/mesa/main/mm.c
	src/mesa/main/mm.h
	src/mesa/main/mtypes.h
	src/mesa/main/points.c
	src/mesa/main/sources
	src/mesa/main/state.c
	src/mesa/main/texcompress_fxt1.c
	src/mesa/main/texenvprogram.c
	src/mesa/main/texobj.c
	src/mesa/main/texstate.c
	src/mesa/main/texstore.c
	src/mesa/math/descrip.mms
	src/mesa/shader/arbprogram.c
	src/mesa/shader/descrip.mms
	src/mesa/shader/prog_execute.c
	src/mesa/shader/prog_statevars.c
	src/mesa/shader/prog_statevars.h
	src/mesa/shader/prog_uniform.c
	src/mesa/shader/program.c
	src/mesa/shader/program.h
	src/mesa/shader/shader_api.c
	src/mesa/shader/slang/descrip.mms
	src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
	src/mesa/sources
	src/mesa/swrast/descrip.mms
	src/mesa/swrast/s_drawpix.c
	src/mesa/swrast/s_fragprog.c
	src/mesa/swrast/s_readpix.c
	src/mesa/swrast/s_span.c
	src/mesa/swrast_setup/descrip.mms
	src/mesa/tnl/descrip.mms
	src/mesa/tnl/t_context.h
	src/mesa/tnl/t_vp_build.c
	src/mesa/tnl/tnl.h
	src/mesa/vbo/descrip.mms
	src/mesa/vbo/vbo_context.c
	src/mesa/vbo/vbo_exec_array.c
	src/mesa/x86-64/xform4.S
	src/mesa/x86/rtasm/x86sse.c
	src/mesa/x86/rtasm/x86sse.h
	windows/VC6/progs/glut/glut.dsp
	windows/VC7/mesa/gdi/gdi.vcproj
	windows/VC7/mesa/glu/glu.vcproj
	windows/VC7/mesa/mesa.sln
	windows/VC7/mesa/mesa/mesa.vcproj
	windows/VC7/mesa/osmesa/osmesa.vcproj
	windows/VC7/progs/glut/glut.vcproj
	windows/VC8/mesa/gdi/gdi.vcproj
	windows/VC8/mesa/glu/glu.vcproj
	windows/VC8/mesa/mesa.sln
	windows/VC8/mesa/mesa/mesa.vcproj
	windows/VC8/progs/glut/glut.vcproj
2008-09-11 16:05:15 +01:00
Brian Paul
af3d9dba56 mesa: set point state 2008-08-12 10:00:36 -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
José Fonseca
101d1a658a mesa: Prefix main includes with dir to avoid conflicts.
Some of the headers in src/mesa/main have pretty common names which
easily conflict with third-party code, e.g. config.h
2008-07-24 21:24:10 +09:00
Brian
e3ca92aa28 mesa: refactor: move _mesa_Bind/Gen/DeleteProgram() to arbprogram.c
No API-level functions now in program.c.
2008-07-21 20:33:42 -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
Nicolai Haehnle
82635aad42 _mesa_clone_program: Copy ShadowSamplers 2008-07-05 18:04:04 +02:00
José Fonseca
18ec140ef2 mesa: Use appropriate unsigned/signed, float/integer types. 2008-06-24 11:34:46 +09:00
Brian Paul
65075da8c3 fix tempReg test in _mesa_combine_programs() 2008-05-19 16:07:10 -06:00
Brian Paul
e469d78d33 fix tempReg test in _mesa_combine_programs() 2008-05-19 16:03:43 -06:00
Brian Paul
0c78c766e4 fixes to _mesa_combine_programs(), from gallium-0.1 2008-05-18 15:46:26 -06:00
Brian Paul
a3e86d43e6 minor changes to aid debugging 2008-05-16 15:16:06 -06:00
Brian Paul
eb4271ea8b remove stray, left-over RefCount++ 2008-05-16 15:16:06 -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
b256273689 fix some additional program refcounting bugs
cherry-picked from master
2008-05-14 12:47:29 -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 Paul
57e222d6e5 fix some additional program refcounting bugs 2008-05-14 12:11:17 -06:00
Brian Paul
b4e75d6c41 disable debug printfs 2008-05-08 10:59:31 -06:00
Brian Paul
5b5c931527 fix refcounting bugs in tnl/tex program caches 2008-05-07 18:51:44 -06:00
Brian Paul
a56a59ce74 gallium: 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.
Another memory bug involving shaders yet to be fixed...

Picked from gallium-0.1
2008-05-07 08:55:33 -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
Alan Hourihane
eec20c359d small cleanups 2008-04-22 20:30:38 +01:00
Brian
5d1e73028a mesa: added _mesa_insert_instructions()
Also, use new _mesa_free_instructions() in a few places.
2008-04-07 11:23:43 -06:00
Brian Paul
72f2c55069 gallium: make sure to set the SamplersUsed field for bitmap/drawpixels shaders
Also, make sure that field is copied/updated in the program clone and combine functions.
Without this we weren't getting SAMP declarations in the TGSI shaders.
2008-04-04 11:20:44 -06:00
Brian Paul
cf7daba791 mesa: fix some issues in _mesa_combine_programs()
Use a temporay register to connect outputs of first program to inputs of
second program.
Also, fix bug in replace_registers(): didn't search/replace DstReg.
2008-03-25 12:30:05 -06:00