aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorPatrice Mandin <[email protected]>2008-03-15 16:45:49 +0100
committerPatrice Mandin <[email protected]>2008-03-15 16:45:49 +0100
commit5e17088ee3d0ddfa8871d92d262bb5242bdd92bd (patch)
treed574279500aa890a5226764316e1214971016612 /src/gallium/drivers
parentd493203045b214770473f8afeaa610542fe42c2a (diff)
cso_context_destroy calls bind_state functions with NULL parameter
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nv30/nv30_state.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv30/nv30_state.c b/src/gallium/drivers/nv30/nv30_state.c
index 722626db1fa..80dfd9c5c0a 100644
--- a/src/gallium/drivers/nv30/nv30_state.c
+++ b/src/gallium/drivers/nv30/nv30_state.c
@@ -40,6 +40,10 @@ nv30_blend_state_bind(struct pipe_context *pipe, void *hwcso)
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_blend_state *cb = hwcso;
+ if (!hwcso) {
+ return;
+ }
+
BEGIN_RING(rankine, NV34TCL_DITHER_ENABLE, 1);
OUT_RING (cb->d_enable);
@@ -236,6 +240,10 @@ nv30_sampler_state_bind(struct pipe_context *pipe, unsigned nr, void **sampler)
struct nv30_context *nv30 = nv30_context(pipe);
unsigned unit;
+ if (!sampler) {
+ return;
+ }
+
for (unit = 0; unit < nr; unit++) {
nv30->tex_sampler[unit] = sampler[unit];
nv30->dirty_samplers |= (1 << unit);
@@ -346,6 +354,10 @@ nv30_rasterizer_state_bind(struct pipe_context *pipe, void *hwcso)
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_rasterizer_state *rs = hwcso;
+ if (!hwcso) {
+ return;
+ }
+
BEGIN_RING(rankine, NV34TCL_SHADE_MODEL, 1);
OUT_RING (rs->shade_model);
@@ -422,6 +434,10 @@ nv30_depth_stencil_alpha_state_bind(struct pipe_context *pipe, void *hwcso)
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_depth_stencil_alpha_state *hw = hwcso;
+ if (!hwcso) {
+ return;
+ }
+
BEGIN_RING(rankine, NV34TCL_DEPTH_FUNC, 3);
OUT_RINGp ((uint32_t *)&hw->depth, 3);
BEGIN_RING(rankine, NV34TCL_STENCIL_BACK_ENABLE, 16);
@@ -455,6 +471,10 @@ nv30_vp_state_bind(struct pipe_context *pipe, void *hwcso)
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_vertex_program *vp = hwcso;
+ if (!hwcso) {
+ return;
+ }
+
nv30->vertprog.current = vp;
nv30->dirty |= NV30_NEW_VERTPROG;
}
@@ -487,6 +507,10 @@ nv30_fp_state_bind(struct pipe_context *pipe, void *hwcso)
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_fragment_program *fp = hwcso;
+ if (!hwcso) {
+ return;
+ }
+
nv30->fragprog.current = fp;
nv30->dirty |= NV30_NEW_FRAGPROG;
}