Commit Graph

33 Commits

Author SHA1 Message Date
Brian Paul
e22e3927b0 gallium: rework handling of sprite_coord_enable state
Implement the pipe_rasterizer_state::sprite_coord_enable field
in the draw module (and softpipe) according to what's specified
in the documentation.

The draw module can now add any number of extra vertex attributes
to a post-transformed vertex and generate texcoords for those
attributes per sprite_coord_enable.  Auto-generated texcoords
for sprites only worked for one texcoord unit before.

The frag shader gl_PointCoord input is now implemented like any
other generic/texcoord attribute.

The draw module now needs to be informed about fragment shaders
since we need to look at the fragment shader's inputs to know
which ones need auto-generated texcoords.

Only softpipe has been updated so far.
2010-09-17 18:45:13 -06:00
Keith Whitwell
9c264642c3 gallium: more work on ccw flag removal
The linux-debug target builds...
2010-05-14 19:20:25 +01:00
Ben Skeggs
b46750d601 st/mesa: use BITFIELD64_BIT to access shader OutputsWritten in more places 2010-03-31 23:34:30 +10:00
Roland Scheidegger
68f93ea3eb gallium: add point_quad_rasterization bit to rasterizer state
This determines if points should be rasterized according to GL point rules
or as normal quads (GL point sprites / d3d points / d3d point sprites).
2010-02-04 21:35:28 +01:00
Roland Scheidegger
4a4daa75a8 gallium: clean up point sprite rasterizer state
Don't need sprite coord origin per coord.
Also, don't need separate sprite enable bit - if all coords have it diabled,
then there are no point sprites (technically, there's a distinction in pre-GL3,
but it only differs in having more leniency in clamping to max size, something
the state tracker would need to handle and the hardware won't bother anyway).
Also, use packed field for the per-coord enables.
All in all, should save 3 dwords in rasterizer state (from 10 down to 7).
2010-02-03 17:25:14 +01:00
Roland Scheidegger
a407636efb gallium: remove point_size_min and point_size_max from rasterizer state
The state tracker is responsible for clamping to any graphics API enforced
size min/max limits for both the static point_size setting as well as per
vertex point size (in the vertex shader).
Note that mesa state tracker didn't actually use these values.
2010-01-12 15:54:13 +01:00
Brian Paul
9038b6c8bb Merge branch 'ext-provoking-vertex'
Conflicts:

	docs/relnotes-7.6.html
	progs/tests/Makefile
	src/gallium/drivers/softpipe/sp_prim_vbuf.c
	src/glx/x11/indirect.c
	src/mesa/glapi/Makefile
	src/mesa/glapi/dispatch.h
	src/mesa/glapi/glapioffsets.h
	src/mesa/glapi/glapitable.h
	src/mesa/glapi/glapitemp.h
	src/mesa/glapi/glprocs.h
	src/mesa/main/dlist.c
	src/mesa/main/enums.c
	src/mesa/sparc/glapi_sparc.S
	src/mesa/x86-64/glapi_x86-64.S
	src/mesa/x86/glapi_x86.S
2009-06-19 09:15:34 -06:00
Brian Paul
0e8a5a8474 st/mesa: fix incorrect sprite origin when drawing to FBO/texture
Need to take the draw buffer's up/down orientation into consideration
when setting the sprite_coord_mode field.

Fixes inverted sprites when drawing into an FBO.
2009-06-01 14:59:11 -06:00
Brian Paul
b631d5fbf4 st: set pipe_rasterizer_state::flatshade_first according to provoking vertex state 2009-05-28 12:33:30 -06:00
Keith Whitwell
106f2b031c mesa/st: remove duplicate offset calculation 2009-04-28 18:15:17 +01:00
Keith Whitwell
1bb60d25e0 gallium: remove remaining references to origin_lower_left 2009-03-21 10:55:45 +00:00
Brian Paul
401cbd0d23 gallium: remove use of origin_lower_left
This was used to indicate OpenGL's lower-left origin for fragment window
coordinates for polygon stipple and gl_FragCoord.

Now:
  - fragment coordinate origin is always upper-left corner
  - GL polygon stipple is inverted and shifted before given to gallium
  - GL fragment programs that use INPUT[WPOS] are modified to use an
    inverted window coord which is placed in a temp register.

Note: the origin_lower_left field still exists in pipe_rasterizer_state.
Remove it when all the drivers, etc. no longer reference it.
2009-03-20 20:29:07 -06:00
Brian Paul
52406c80d6 gallium: fix two-sided lighting test in state tracker
This fixes two-sided lighting for vertex shaders.
2008-12-18 16:00:20 -07:00
Brian Paul
f7556fdd40 mesa: rasterizer state depends on ST_NEW_VERTEX_PROGRAM
Check for per-vertex point size must be done when vertex program changes.
2008-10-09 16:39:59 -06:00
Brian Paul
1a820f52f6 gallium: clean-up/fix msaa override in state tracker 2008-09-17 14:32:33 -06:00
Brian Paul
e552140a9a gallium: added _NEW_PROGRAM to dependencies 2008-08-11 15:21:40 -06:00
Michal Krol
6c534b830c st: Silence compiler warnings on Windows. 2008-07-15 11:48:59 +02:00
Roland Scheidegger
489fc4d10a mesa: fix issues around multisample enable
multisample enable is enabled by default, however gl mandates multisample
rendering rules only apply if there's also a multisampled buffer.
2008-07-02 20:22:08 +02:00
Alan Hourihane
54507125e7 Some changed for non-C99 compilers 2008-05-02 10:30:34 +00:00
Keith Whitwell
8e33194837 gallium: add a flag to turn on gl rasterization rules
Use this to set up hardware rasterization (if your hardware can
do it) or otherwise turn on various tweaks in the draw module.

Currently only hooked up to point biasing code.
2008-04-02 11:38:33 +01:00
Keith Whitwell
bc739440c2 gallium: add temporary facility for rasterization-time clamping of point sizes 2008-04-02 10:44:04 +01:00
Brian Paul
cbf42c45a1 gallium: if point size not computed per vertex, apply size clamp immediately.
Fixes glean pointAtten failure.
2008-03-14 17:45:27 -06:00
Brian
339e7ec680 gallium: rework CSO-related code in state tracker
Use the code in cso_context.c rather than st_cache.c.
Basically, binding of state objects now goes through the CSO module.
But Vertex/fragment shaders go through pipe->bind_fs/vs_state() since they're
not cached by the CSO module at this time.

Also, update softpipe driver to handle NULL state objects in various places.
This happens during context destruction.  May need to update other drivers...
2008-03-11 18:55:58 -06:00
Brian
09ba1dd4cc gallium: clamp line width when creating raster state object 2008-02-25 16:25:24 -07:00
Brian
2444f6c6a4 gallium: fix computation of raster.point_size_per_vertex flag 2008-01-23 08:24:30 -07:00
Brian
dd235ff1db Fix a two-sided lighting bug (fixes samples/wave.c) 2008-01-16 08:30:00 -07:00
Brian
52da6b559a fix bug on GL_VERTEX_PROGRAM_TWO_SIDE path 2007-12-18 16:01:53 -07:00
Brian
017f862de1 Added origin_lower_left field to pipe_rasterizer_state
This controls whether the window origin is considered to be the lower-left
or upper-left corner.
This effects computation of gl_FragCoord and the application of polygon stipple.
2007-12-14 12:25:25 -07:00
Brian
beefc6011b new flag to control psize (from vertex shader or fixed size) 2007-10-22 12:19:54 -06:00
Brian
1b48523459 add support for sprite texcoord modes 2007-10-22 12:10:30 -06:00
Brian
cd4d732773 add point_sprite flag to rasterizer state 2007-10-22 11:41:31 -06:00
Zack Rusin
fe555c39bb Convert the rasterizer cso to the new semantics.
Basically make cso hold the driver specific struct, while
managing the template.
2007-09-19 14:01:18 -04:00
Zack Rusin
de69fc1703 Finishing up rename of the setup state to the rasterizer state. 2007-09-18 10:02:16 -04:00