summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-03-12 02:59:20 +1100
committerBen Skeggs <[email protected]>2008-03-12 02:59:42 +1100
commit9c29512154992f95c11939615ddcbef185c6a96c (patch)
tree2cba3479043862016411c31f19c8393c07e7b0ed /src
parent3250bacd2411d3f1af50135599380b2140238535 (diff)
nv50: crappy state validate/emit function
Just for testing stateobjs to make sure they don't hang the engine.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nv50/Makefile1
-rw-r--r--src/gallium/drivers/nv50/nv50_context.h2
-rw-r--r--src/gallium/drivers/nv50/nv50_state_validate.c14
-rw-r--r--src/gallium/drivers/nv50/nv50_vbo.c8
4 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/Makefile b/src/gallium/drivers/nv50/Makefile
index 1c0b82887a1..a62a4d961bc 100644
--- a/src/gallium/drivers/nv50/Makefile
+++ b/src/gallium/drivers/nv50/Makefile
@@ -11,6 +11,7 @@ DRIVER_SOURCES = \
nv50_query.c \
nv50_screen.c \
nv50_state.c \
+ nv50_state_validate.c \
nv50_surface.c \
nv50_vbo.c
diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h
index 6096818d40d..98b9aba0796 100644
--- a/src/gallium/drivers/nv50/nv50_context.h
+++ b/src/gallium/drivers/nv50/nv50_context.h
@@ -70,4 +70,6 @@ extern boolean nv50_draw_elements(struct pipe_context *pipe,
extern void nv50_clear(struct pipe_context *pipe, struct pipe_surface *ps,
unsigned clearValue);
+extern boolean nv50_state_validate(struct nv50_context *nv50);
+
#endif
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c
new file mode 100644
index 00000000000..a89d1526c58
--- /dev/null
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
@@ -0,0 +1,14 @@
+#include "nv50_context.h"
+#include "nouveau/nouveau_stateobj.h"
+
+boolean
+nv50_state_validate(struct nv50_context *nv50)
+{
+ struct nouveau_winsys *nvws = nv50->screen->nvws;
+
+ if (nv50->dirty & NV50_NEW_BLEND)
+ so_emit(nvws, nv50->blend->so);
+
+ return TRUE;
+}
+
diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c
index 6c0dc23a439..b01ce1d42c5 100644
--- a/src/gallium/drivers/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nv50/nv50_vbo.c
@@ -9,6 +9,10 @@ boolean
nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start,
unsigned count)
{
+ struct nv50_context *nv50 = nv50_context(pipe);
+
+ nv50_state_validate(nv50);
+
NOUVEAU_ERR("unimplemented\n");
return TRUE;
}
@@ -18,6 +22,10 @@ nv50_draw_elements(struct pipe_context *pipe,
struct pipe_buffer *indexBuffer, unsigned indexSize,
unsigned mode, unsigned start, unsigned count)
{
+ struct nv50_context *nv50 = nv50_context(pipe);
+
+ nv50_state_validate(nv50);
+
NOUVEAU_ERR("unimplemented\n");
return TRUE;
}