Commit Graph

251 Commits

Author SHA1 Message Date
Brian Paul
ec2b92f98c mesa: rename src/mesa/shader/ to src/mesa/program/ 2010-06-10 23:23:13 -06:00
Henri Verbeet
f820b263db mesa: update_arrays() depends on program state.
It uses ctx->VertexProgram._Current.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-05 09:34:31 -06:00
Kristian Høgsberg
298be2b028 Replace the _mesa_*printf() wrappers with the plain libc versions 2010-02-19 12:32:24 -05:00
Brian Paul
af1e9403e7 mesa: remove redundant _MaxElement computation
Eric added some new code to check if offset < obj_size before computing
_MaxElement but my original code was still present afterward and it
clobbered the _MaxElement value.

Not sure if this came from a bad merge or what.
2010-01-26 10:53:40 -07:00
Vinson Lee
6603550353 mesa: Remove unnecessary header from state.c. 2010-01-18 18:54:54 -08:00
Chia-I Wu
dbb8fb8de9 mesa/main: Make FEATURE_pixel_transfer follow feature conventions.
As shown in mfeatures.h, this allows users of pixel.h to work without
knowing if the feature is available.
2009-09-24 21:48:05 -06:00
Brian Paul
28cfd37bb3 mesa: use a more logical flag in _mesa_set_vp_override() 2009-08-07 09:50:38 -06:00
Eric Anholt
03187571b6 texenv: Add missing dependency on VP changes.
Funny thing is I annotated this dependency in
e5f63c403b, but didn't actually use it.
2009-08-03 12:54:17 -07:00
Eric Anholt
9cea84b6b5 texenv: Calculate whether we need to do secondary color on our own.
The _TriangleCaps bit is deprecated, not updated when we require, and
is set based on state that hasn't been updated at that point in
_mesa_update_state_locked().

Fixes incorrect clear color in glsl/twoside.c with meta_clear_tris.
2009-07-16 19:02:04 -07:00
Eric Anholt
e5f63c403b Fix state flag dependencies for fixed function fragment program updates.
I started looking into why _NEW_ARRAY punishes us, and while annotating
dependencies noticed that a bunch of dependencies were missing.
2009-07-14 15:14:52 -07:00
Eric Anholt
058e96916b Cap array elements at 0 when passed an invalid pointer for an array object.
Otherwise, a pointer greater than the size would underflow and give a large
maximum element.

Reviewed-by: Brian Paul <brianp@vmware.com> (previous version)
2009-07-07 15:16:28 -07:00
Brian Paul
68d412f31c mesa: add missing update_min() call in update_arrays() 2009-05-22 15:35:49 -06:00
Brian Paul
fac334e6d3 Merge branch 'mesa_7_5_branch' 2009-05-22 14:09:35 -06:00
Brian Paul
1045481dd9 mesa: fix loop over generic attribs in update_arrays() 2009-05-22 13:50:31 -06:00
Brian Paul
a185bcbdec mesa: move gl_array_attrib::_MaxElement to gl_array_object::_MaxElement
This value is per array object.
2009-05-21 09:17:08 -06:00
Brian Paul
b9d0f947f2 mesa: Compute gl_client_array->_MaxElement during array validation
Used to be done in the glVertex/Normal/Color/etc/Pointer() calls but
if the VBO was reallocated the size could change.
New _NEW_BUFFER_OBJECT state flag.
2009-05-07 10:12:33 -06:00
Brian Paul
a6c8e900af mesa: use local var to make code a bit more concise 2009-05-07 10:12:33 -06:00
Brian Paul
64e331eb52 mesa: new _NEW_PROGRAM_CONSTANTS flag
This state flag will be used to indicate that vertex/fragment program
constants have changed.  _NEW_PROGRAM will be used to indicate changes
to the vertex/fragment shader itself, or misc related state.

_NEW_PROGRAM_CONSTANTS is also set whenever a program parameter that's
tracking GL state has changed.  For example, if the projection matrix is
in the parameter list, calling glFrustum() will cause _NEW_PROGRAM_CONSTANTS
to be set.  This will let to remove the need for dynamic state atoms in
some drivers.

For now, we still set _NEW_PROGRAM in all the places we used to.  We'll no
longer set _NEW_PROGRAM in glUniform() after drivers/etc have been updated.
2009-04-21 16:21:32 -06:00
Eric Anholt
c710430f3a mesa: Update texenv program when _NEW_ARRAYS is updated as well.
This fixes a regression in fbotest1 on 915, where a transition from
color+vertex array enabled to texcoord0+vertex array enabled wouldn't trigger
program update on the second _mesa_update_state of DrawArrays, and we'd sample
a constant texcoord of 0,0,0,1 instead of the array.

The double state update in DrawArrays from
1680ef8696 still needs fixing.
2009-04-15 12:55:50 -07:00
Brian Paul
2c37851595 mesa: move glViewport and glDepthRange functions into new viewport.c file
A bit of refactoring with an eye toward ES2 and GL 3.1
2009-03-07 12:33:11 -07:00
Brian Paul
de1caa5507 mesa: fix sw fallback state validation bug
When a hw driver fell back to swrast, swrast wasn't always getting informed
of program changes.  When fixed function is translated into shaders, flags
like _NEW_LIGHT, _NEW_TEXTURE, etc. should really signal _NEW_PROGRAM.
In this case, swrast wasn't seeing _NEW_PROGRAM when new fragment shaders
were generated.
2009-03-03 13:55:25 -07:00
Brian Paul
f352a80aec mesa: add ctx->Stencil._Enabled field
Only true if stenciling is enabled, and there's a stencil buffer.
2009-03-02 11:49:37 -07:00
Brian Paul
5340b6dff7 Merge commit 'origin/gallium-master-merge'
This is the big merge of the gallium-0.2 branch into master.
gallium-master-merge was just the staging area for it.
Both gallium-0.2 and gallium-master-merge are considered closed now.

Conflicts:

	progs/demos/Makefile
	src/mesa/main/state.c
	src/mesa/main/texenvprogram.c
2009-02-10 16:44:02 -07:00
Brian Paul
537d3ed6f3 mesa: another fix for program/texture state validation
This fixes a regression introduced in 46ae1abbac

Break program validation into two steps, do part before texture state
validation and do the rest after:
1. Determine Vertex/Fragment _Enabled state.
2. Update texture state.
3. Determine pointers to current Vertex/Fragment programs (which may involve
generating new "fixed-function" programs).

See comments in the code for more details of the dependencies.
2009-02-10 16:28:25 -07:00
Brian Paul
1ed5fe5cbf mesa: s/_IMAGE_NEW_TRANSFER_STATE/_MESA_NEW_TRANSFER_STATE/ to be more consistant with other flags 2009-02-10 15:53:35 -07:00
Brian Paul
46ae1abbac mesa: fix/change state validation order for program/texture state
Program state needs to be updated before texture state since the later depends
on the former.

Fixes piglit texgen failure.  The second time through the modes (press 't'
three times) we disable the fragment program and return to conventional texture
mode.  State validation failed here because update_texture() saw stale fragment
program state.
2009-02-10 15:53:35 -07:00
Eric Anholt
510916f509 mesa: Remove _Active and _UseTexEnvProgram flags from fragment programs.
There was a note in state.c about _Active deserving to die, and there were
potential issues with it due to i965 forgetting to set _UseTexEnvProgram.
Removing both simplifies things.

Reviewed-by: Brian Paul <brianp@vmware.com>
2009-01-09 11:16:39 +00:00
Eric Anholt
8fb727548a mesa: Remove _Active and _UseTexEnvProgram flags from fragment programs.
There was a note in state.c about _Active deserving to die, and there were
potential issues with it due to i965 forgetting to set _UseTexEnvProgram.
Removing both simplifies things.

Reviewed-by: Brian Paul <brianp@vmware.com>
2009-01-07 20:34:46 -08:00
Brian Paul
60410fc858 mesa: remove unneeded _mesa_reference_fragprog() call
The subsequent if/else cases always call _mesa_reference_fragprog() anyway.
2008-12-18 14:17:06 -07:00
Brian Paul
35aebf4667 mesa: remove unneeded _mesa_reference_fragprog() call
The subsequent if/else cases always call _mesa_reference_fragprog() anyway.
2008-12-17 18:05:03 -07:00
Alan Hourihane
e4c9aeed8b mesa: fix generation of fixed function state when no vp exists 2008-11-13 13:31:10 +00:00
Alan Hourihane
16340f8d4d mesa: fix generation of fixed function state when no vp exists 2008-11-13 13:16:03 +00:00
Keith Whitwell
cf85e413ad Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:

	src/mesa/main/context.c
2008-10-15 17:20:30 +01:00
Brian Paul
6d4d51d647 mesa: new _mesa_set_vp_override() function for driver-override of vertex program
Patch provide by Keith.
Used in state tracker by DrawPixels to indicate that the state tracker (driver)
is using its own vertex program.  This prevents the texenvprogram code from
replacing conventional shader inputs with state vars.
Fixes glDraw/CopyPixels regressions.
2008-10-10 13:39:14 -06: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
239617fbe2 mesa: replace GLuint with GLbitfield to be clearer about usage
Also, fix up some comments to be doxygen style.
2008-10-07 11:22:47 -06:00
Keith Whitwell
1680ef8696 mesa: avoid generating constant vertex attributes in fixedfunc programs
Keep track of enabled/active vertex attributes.
Keep track of potential vertex program outputs.

When generating fragment program, replace references to fragment attributes
which are effectively non-varying and non-computed passthrough attributes with
references to the new CURRENT_ATTRIB tracked state value.

Only downside is slight ugliness in VBO code where we need to validate state
twice in succession.
2008-10-03 17:30:59 +01:00
Keith Whitwell
fa1b533012 mesa: add new internal state for tracking current vertex attribs 2008-10-03 16:49:52 +01:00
Brian Paul
a4a5a37f27 mesa: remove invalid assertions that programs have parameters
Fixes failure with demos/fplight.c
2008-09-26 07:45:06 -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
Keith Whitwell
34a61c66fd mesa: refactor: move #define FEATURE flags into new mfeatures.h file
Also, check the FEATURE flags in many places.
(cherry picked from commit 40d1a40f29)

Conflicts:

	src/mesa/main/config.h
	src/mesa/main/context.c
	src/mesa/main/texobj.c
	src/mesa/main/texstate.c
	src/mesa/main/texstore.c
2008-09-21 22:13:52 -07:00
Brian Paul
c9e5671691 mesa: refactor: move _mesa_init_exec_table() into new api_exec.c file
(cherry picked from commit b36e6f0baf)
2008-09-21 22:13:51 -07:00
Brian Paul
28876dd511 mesa: refactor: move glReadPixels code into new readpix.c file 2008-09-21 22:13:51 -07:00
Brian Paul
411d6672a6 mesa: refactor: move glPixelStore function into new pixelstore.c file 2008-09-21 22:13:51 -07:00
Brian Paul
9228f1c881 mesa: remove EXT/NV suffixes from _mesa_PointParameter functions 2008-09-21 22:13:50 -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
Keith Whitwell
89ab66448e Merge commit 'origin/master' into gallium-0.2
Conflicts:

	progs/trivial/Makefile
	src/mesa/glapi/glthread.c
2008-09-18 19:03:02 +01:00
Brian Paul
9d48a7832b mesa: fix MSAA enable state in update_multisample() 2008-09-15 17:14:53 -06:00
Brian Paul
b1f5fbe1cb mesa: fix MSAA enable state in update_multisample() 2008-09-15 17:10:04 -06:00