summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-19 18:53:36 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-09-19 18:53:59 -0600
commit37cf13ed9a429c755f121daa1776b1b30a985ab3 (patch)
tree8ae423c054011d6826024b173e1de892c8bed78e /src/mesa/state_tracker/st_cb_drawpixels.c
parent83a674a7af4e58f677a56aae2111d2cbdbf1e21d (diff)
Checkpoint: replacement of TGSI_ATTRIB_x tokens with input/output semantics.
TGSI_ATTRIB_x tokens still present and used in a few places. Expanded set of TGSI_SEMANTIC_x tokens for describing the meaning of inputs/outputs. These tokens are in a crude state ATM. Lots of #if 0 / disabled code to be removed yet, etc... Softpipe and i915 drivers should be in working condition but not heavily tested.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 0fd728c930..d4f260ee54 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -56,11 +56,9 @@
static struct st_fragment_program *
make_fragment_shader(struct st_context *st)
{
- static const GLuint outputMapping[2] = { 1, 0 };
GLcontext *ctx = st->ctx;
struct st_fragment_program *stfp;
struct gl_program *p;
- GLboolean b;
GLuint interpMode[16];
GLuint i;
@@ -94,11 +92,7 @@ make_fragment_shader(struct st_context *st)
p->OutputsWritten = (1 << FRAG_RESULT_COLR);
stfp = (struct st_fragment_program *) p;
- /* compile into tgsi format */
- b = tgsi_mesa_compile_fp_program(&stfp->Base, NULL, interpMode,
- outputMapping,
- stfp->tokens, ST_FP_MAX_TOKENS);
- assert(b);
+ st_translate_fragment_shader(st, stfp);
return stfp;
}
@@ -112,11 +106,9 @@ static struct st_vertex_program *
make_vertex_shader(struct st_context *st)
{
/* Map VERT_RESULT_HPOS to 0, VERT_RESULT_TEX0 to 1 */
- static const GLuint outputMapping[] = { 0, 0, 0, 0, 1 };
GLcontext *ctx = st->ctx;
struct st_vertex_program *stvp;
struct gl_program *p;
- GLboolean b;
p = ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
if (!p)
@@ -149,11 +141,7 @@ make_vertex_shader(struct st_context *st)
(1 << VERT_RESULT_HPOS));
stvp = (struct st_vertex_program *) p;
- /* compile into tgsi format */
- b = tgsi_mesa_compile_vp_program(&stvp->Base, NULL,
- outputMapping,
- stvp->tokens, ST_FP_MAX_TOKENS);
- assert(b);
+ st_translate_vertex_shader(st, stvp);
return stvp;
}
@@ -339,32 +327,19 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
/* fragment shader state: TEX lookup program */
{
static struct st_fragment_program *stfp = NULL;
- struct pipe_shader_state fs;
- struct pipe_shader_state *cached;
if (!stfp) {
stfp = make_fragment_shader(ctx->st);
}
- memset(&fs, 0, sizeof(fs));
- fs.inputs_read = stfp->Base.Base.InputsRead;
- fs.tokens = &stfp->tokens[0];
- cached = st_cached_fs_state(ctx->st, &fs);
- pipe->bind_fs_state(pipe, cached);
+ pipe->bind_fs_state(pipe, stfp->fs);
}
/* vertex shader state: position + texcoord pass-through */
{
static struct st_vertex_program *stvp = NULL;
- struct pipe_shader_state vs;
- struct pipe_shader_state *cached;
if (!stvp) {
stvp = make_vertex_shader(ctx->st);
}
- memset(&vs, 0, sizeof(vs));
- vs.inputs_read = stvp->Base.Base.InputsRead;
- vs.outputs_written = stvp->Base.Base.OutputsWritten;
- vs.tokens = &stvp->tokens[0];
- cached = st_cached_vs_state(ctx->st, &vs);
- pipe->bind_vs_state(pipe, cached);
+ pipe->bind_vs_state(pipe, stvp->vs);
}
/* texture sampling state: */