summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv40/nv40_context.h
diff options
context:
space:
mode:
authorBen Skeggs <darktama@beleth.(none)>2008-02-20 16:21:28 +1100
committerBen Skeggs <darktama@beleth.(none)>2008-02-20 16:21:28 +1100
commit46c3d0918dd7a47f69c21e4eb1a3fd2a2fbe6223 (patch)
treed6bb0d185cdea7cc33c3f2341beb787a88fbbe6f /src/gallium/drivers/nv40/nv40_context.h
parentc0f9cab905f3f54cc01bf947665f8a731b8cb347 (diff)
nv40: keep track of generated context state vs current channel state
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_context.h')
-rw-r--r--src/gallium/drivers/nv40/nv40_context.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/gallium/drivers/nv40/nv40_context.h b/src/gallium/drivers/nv40/nv40_context.h
index 28a0274d771..2dd137ead0f 100644
--- a/src/gallium/drivers/nv40/nv40_context.h
+++ b/src/gallium/drivers/nv40/nv40_context.h
@@ -22,6 +22,15 @@
#define NOUVEAU_MSG(fmt, args...) \
fprintf(stderr, "nouveau: "fmt, ##args);
+enum nv40_state_index {
+ NV40_STATE_CLIP = 1ULL,
+ NV40_STATE_SCISSOR = 2ULL,
+ NV40_STATE_STIPPLE = 3ULL,
+ NV40_STATE_FRAGPROG = 4ULL,
+ NV40_STATE_VERTPROG = 5ULL,
+ NV40_STATE_MAX = 6ULL
+};
+
#define NV40_NEW_BLEND (1 << 0)
#define NV40_NEW_RAST (1 << 1)
#define NV40_NEW_ZSA (1 << 2)
@@ -56,6 +65,9 @@ struct nv40_channel_context {
/* Vtxprog resources */
struct nouveau_resource *vp_exec_heap;
struct nouveau_resource *vp_data_heap;
+
+ /* Current 3D state of channel */
+ struct nouveau_stateobj *state[NV40_STATE_MAX];
};
struct nv40_rasterizer_state {
@@ -64,18 +76,10 @@ struct nv40_rasterizer_state {
};
struct nv40_state {
- struct {
- unsigned enabled;
- struct nouveau_stateobj *so;
- } scissor;
-
- struct {
- unsigned enabled;
- struct nouveau_stateobj *so;
- } stipple;
+ unsigned scissor_enabled;
+ unsigned stipple_enabled;
- struct nouveau_stateobj *fragprog;
- struct nouveau_stateobj *vertprog;
+ struct nouveau_stateobj *hw[NV40_STATE_MAX];
};
struct nv40_context {