summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_shader.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-14 19:12:46 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-14 19:13:34 -0700
commitac95fee4fffee77bb7bd798d094ed2e3a7c4019b (patch)
treedb6569f204ba1414d11c7bf4be8b47dafb7c2b0c /src/mesa/state_tracker/st_atom_shader.c
parentb4e4fafb4157d416077e985c03204ed5bbe0f2e1 (diff)
Fix problems with vertex shaders and the private draw module.
The CSO returned by pipe->create_vs_state() can't be passed to the private draw module. That was causing glRasterPos to blow up. Add a 'draw_shader' field to st_vertex_program for use with the private draw module. Change st_context->state.vs type from cso_vertex_shader to st_vertex_program.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_shader.c')
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index 2a182c7d9c..1ed9333556 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -43,6 +43,8 @@
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
+#include "pipe/cso_cache/cso_cache.h"
+
#include "st_context.h"
#include "st_cache.h"
#include "st_atom.h"
@@ -71,8 +73,8 @@ struct translated_vertex_program
/** The program in TGSI format */
struct tgsi_token tokens[ST_MAX_SHADER_TOKENS];
- /** Pointer to the translated, cached vertex shader */
- const struct cso_vertex_shader *vs;
+ /** Pointer to the translated vertex program */
+ struct st_vertex_program *vp;
struct translated_vertex_program *next; /**< next in linked list */
};
@@ -257,12 +259,13 @@ find_translated_vp(struct st_context *st,
assert(stvp->Base.Base.NumInstructions > 1);
- xvp->vs = st_translate_vertex_program(st, stvp,
- xvp->output_to_slot,
- xvp->tokens,
- ST_MAX_SHADER_TOKENS);
- assert(xvp->vs);
- stvp->vs = NULL; /* don't want to use this */
+ st_translate_vertex_program(st, stvp,
+ xvp->output_to_slot,
+ xvp->tokens,
+ ST_MAX_SHADER_TOKENS);
+
+ assert(stvp->cso);
+ xvp->vp = stvp;
/* translated VP is up to date now */
xvp->serialNo = stvp->serialNo;
@@ -291,8 +294,8 @@ update_linkage( struct st_context *st )
xvp = find_translated_vp(st, stvp, stfp);
st->vp = stvp;
- st->state.vs = xvp->vs;
- st->pipe->bind_vs_state(st->pipe, st->state.vs->data);
+ st->state.vs = xvp->vp;
+ st->pipe->bind_vs_state(st->pipe, st->state.vs->cso->data);
st->fp = stfp;
st->state.fs = stfp->fs;