summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2012-05-23 22:36:47 -0700
committerVinson Lee <[email protected]>2012-05-24 18:50:07 -0700
commit35f302d97e5b6f5fc4964e70f7adae706c5b7162 (patch)
treed8ccc5035154fa0a473d08fbb058f38dd807b4a0 /src/gallium/drivers/i915
parent5cf693266faebd1fc130709fd7e7b2452bbd156c (diff)
i915g: Check for geometry shader earlier in i915_set_constant_buffer.
Fix resource leak defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/i915')
-rw-r--r--src/gallium/drivers/i915/i915_state.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index bd9e8bac0ae..1ff53884ada 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -672,16 +672,16 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
unsigned new_num = 0;
boolean diff = TRUE;
+ /* XXX don't support geom shaders now */
+ if (shader == PIPE_SHADER_GEOMETRY)
+ return;
+
if (cb && cb->user_buffer) {
buf = i915_user_buffer_create(pipe->screen, cb->user_buffer,
cb->buffer_size,
PIPE_BIND_CONSTANT_BUFFER);
}
- /* XXX don't support geom shaders now */
- if (shader == PIPE_SHADER_GEOMETRY)
- return;
-
/* if we have a new buffer compare it with the old one */
if (buf) {
struct i915_buffer *ibuf = i915_buffer(buf);