galahad, i915g: Copy over constant buffer index check.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 20 Aug 2010 07:18:30 +0000 (00:18 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 20 Aug 2010 07:18:30 +0000 (00:18 -0700)
src/gallium/drivers/galahad/glhd_context.c
src/gallium/drivers/i915/i915_state.c

index 10e4679bf1b990c7f1b5af16f597d86629afca5a..383c448926160195584a1616142a7697427de14a 100644 (file)
@@ -463,6 +463,15 @@ galahad_set_constant_buffer(struct pipe_context *_pipe,
       glhd_error("Unknown shader type %u", shader);
    }
 
+   if (index &&
+      index >=
+         pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_CONST_BUFFERS)) {
+      glhd_error("Access to constant buffer %u requested, "
+         "but only %d are supported",
+         index,
+         pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_CONST_BUFFERS));
+   }
+
    /* XXX hmm? unwrap the input state */
    if (_resource) {
       unwrapped_resource = galahad_resource_unwrap(_resource);
index cbddb214fb436c42ec8af67526dca97a6fd8da7a..8c53b06931bd6ca280d239262952da7dc11d955a 100644 (file)
@@ -527,8 +527,6 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
    struct i915_context *i915 = i915_context(pipe);
    draw_flush(i915->draw);
 
-   assert(index == 0);
-
    /* Make a copy of shader constants.
     * During fragment program translation we may add additional
     * constants to the array.