aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-30 11:16:55 -0600
committerBrian <[email protected]>2007-10-30 11:32:53 -0600
commitde38d9c498b999d80b51679ece6b4caccd80a2b8 (patch)
tree40f8f5a35ad7211c34e66bb63ffab51b2b24d9af /src/mesa/state_tracker/st_cb_drawpixels.c
parentb8042fb7fb15a4f99a10f9d9e48d43301622c2bf (diff)
checkpoint: combine pixel transfer and user shader for glDrawPixels
Diffstat (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 3c573174154..ed0ef71192d 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -33,9 +33,13 @@
#include "main/imports.h"
#include "main/image.h"
#include "main/macros.h"
+#include "shader/program.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
#include "st_context.h"
#include "st_atom.h"
+#include "st_atom_constbuf.h"
#include "st_cache.h"
#include "st_draw.h"
#include "st_program.h"
@@ -173,6 +177,34 @@ make_fragment_shader(struct st_context *st, GLboolean bitmapMode)
}
+static struct st_fragment_program *
+make_drawpix_fragment_shader(struct st_context *st)
+{
+ GLcontext *ctx = st->ctx;
+ struct st_fragment_program *stfp;
+ struct gl_program *p;
+
+ printf("====== drawpix combine progs\n");
+ p = _mesa_combine_programs(ctx,
+ &st->pixel_transfer_program->Base,
+ &ctx->FragmentProgram._Current->Base);
+
+ _mesa_print_program(p);
+ printf("InputsRead: 0x%x\n", p->InputsRead);
+ printf("OutputsWritten: 0x%x\n", p->OutputsWritten);
+ _mesa_print_parameter_list(p->Parameters);
+
+ stfp = (struct st_fragment_program *) p;
+ st_translate_fragment_program(st, stfp, NULL,
+ stfp->tokens, ST_MAX_SHADER_TOKENS);
+
+
+ st_upload_constants( st, p->Parameters, PIPE_SHADER_FRAGMENT );
+
+ return stfp;
+}
+
+
/**
* Create fragment shader that does a TEX() instruction to get a Z
* value, then writes to FRAG_RESULT_DEPR.
@@ -899,7 +931,7 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
else {
ps = st->state.framebuffer.cbufs[0];
- stfp = make_fragment_shader(ctx->st, GL_FALSE);
+ stfp = make_drawpix_fragment_shader(ctx->st);
stvp = make_vertex_shader(ctx->st, GL_FALSE);
color = NULL;
}