/**
* Make fragment shader for glDraw/CopyPixels. This shader is made
* by combining the pixel transfer shader with the user-defined shader.
+ * \return pointer to Gallium driver fragment shader
*/
-static struct st_fragment_program *
+static void *
combined_drawpix_fragment_program(GLcontext *ctx)
{
struct st_context *st = st_context(ctx);
*/
st_upload_constants(st, stfp->Base.Base.Parameters, PIPE_SHADER_FRAGMENT);
- return stfp;
+ return stfp->driver_shader;
}
* Create fragment shader that does a TEX() instruction to get a Z
* value, then writes to FRAG_RESULT_DEPTH.
* Pass fragment color through as-is.
+ * \return pointer to the Gallium driver fragment shader
*/
-static struct st_fragment_program *
+static void *
make_fragment_shader_z(struct st_context *st)
{
GLcontext *ctx = st->ctx;
GLuint ic = 0;
if (st->drawpix.z_shader) {
- return st->drawpix.z_shader;
+ return st->drawpix.z_shader->driver_shader;
}
/*
st->drawpix.z_shader = (struct st_fragment_program *) p;
st_translate_fragment_program(st, st->drawpix.z_shader);
- return st->drawpix.z_shader;
+ return st->drawpix.z_shader->driver_shader;
}
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels)
{
- struct st_fragment_program *stfp;
- void *driver_vp;
+ void *driver_vp, *driver_fp;
struct st_context *st = st_context(ctx);
const GLfloat *color;
st_validate_state(st);
if (format == GL_DEPTH_COMPONENT) {
- stfp = make_fragment_shader_z(st);
+ driver_fp = make_fragment_shader_z(st);
driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE);
color = ctx->Current.RasterColor;
}
else {
- stfp = combined_drawpix_fragment_program(ctx);
+ driver_fp = combined_drawpix_fragment_program(ctx);
driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE);
color = NULL;
}
width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
pt,
driver_vp,
- stfp->driver_shader,
+ driver_fp,
color, GL_FALSE);
pipe_texture_reference(&pt, NULL);
}
struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen;
struct st_renderbuffer *rbRead;
- void *driver_vp;
- struct st_fragment_program *stfp;
+ void *driver_vp, *driver_fp;
struct pipe_texture *pt;
GLfloat *color;
enum pipe_format srcFormat, texFormat;
if (type == GL_COLOR) {
rbRead = st_get_color_read_renderbuffer(ctx);
color = NULL;
- stfp = combined_drawpix_fragment_program(ctx);
+ driver_fp = combined_drawpix_fragment_program(ctx);
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);
+ driver_fp = make_fragment_shader_z(st);
driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE);
}
width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY,
pt,
driver_vp,
- stfp->driver_shader,
+ driver_fp,
color, GL_TRUE);
pipe_texture_reference(&pt, NULL);