i915g: don't validate a NULL vbo
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 5 Mar 2011 22:17:56 +0000 (23:17 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 10 Mar 2011 21:47:47 +0000 (22:47 +0100)
With the new clear code this is possible (if the app call glClear
before drawing the first primitive).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
src/gallium/drivers/i915/i915_state_emit.c

index 15350c0a5d710b322b19ae69198b0892a0957384..324a8a3e158cfd4161cce6c39f62135108a87356 100644 (file)
@@ -119,7 +119,7 @@ validate_immediate(struct i915_context *i915, unsigned *batch_space)
                      1 << I915_IMMEDIATE_S5 | 1 << I915_IMMEDIATE_S6) &
                     i915->immediate_dirty;
 
-   if (i915->immediate_dirty & (1 << I915_IMMEDIATE_S0))
+   if (i915->immediate_dirty & (1 << I915_IMMEDIATE_S0) && i915->vbo)
       i915->validation_buffers[i915->num_validation_buffers++] = i915->vbo;
 
    *batch_space = 1 + util_bitcount(dirty);