summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-11-15 11:15:25 -0800
committerKeith Whitwell <keithw@vmware.com>2009-11-15 11:23:30 -0800
commit07fafc7c9346aa260829603bf3188596481e9e62 (patch)
treed0b4d9730b63db91b9f52f537c4e2f80ddc980da /src/mesa/state_tracker/st_cb_drawpixels.c
parent1454f20a991ddda35f1a2ffda953012078b407ba (diff)
mesa/st: refactor vertex and fragment shader translation
Translate vertex shaders independently of fragment shaders. Previously tried to make fragment shader semantic indexes always start at zero and exclude holes. This was unnecessary but meant that vertex shader translation had to be adjusted to take this into account. Now use a fixed scheme for labelling special FS input semantics (color, etc), and another fixed scheme for the generics. With this, vertex shaders can be translated independently of the bound fragment shader, assuming mesa has done its own job and ensured that the vertex shader provides at least the inputs the fragment shader is looking for. The state-tracker didn't attempt to do anything about this previously, so it shouldn't be needed now.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 13e454b7a7..60394731f7 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -927,7 +927,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen;
struct st_renderbuffer *rbRead;
- struct st_vertex_program *stvp;
+ void *driver_vp;
struct st_fragment_program *stfp;
struct pipe_texture *pt;
GLfloat *color;
@@ -976,14 +976,14 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
rbRead = st_get_color_read_renderbuffer(ctx);
color = NULL;
stfp = combined_drawpix_fragment_program(ctx);
- stvp = st_make_passthrough_vertex_shader(st, GL_FALSE);
+ driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE);
}
else {
assert(type == GL_DEPTH);
rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
stfp = make_fragment_shader_z(st);
- stvp = st_make_passthrough_vertex_shader(st, GL_TRUE);
+ driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE);
}
srcFormat = rbRead->texture->format;
@@ -1116,7 +1116,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2],
width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
pt,
- stvp->driver_shader,
+ driver_vp,
stfp->driver_shader,
color, GL_TRUE);