Mesa (master): galahad, i915g: Copy over constant buffer index check.

Corbin Simpson csimpson at kemper.freedesktop.org
Fri Aug 20 07:40:28 UTC 2010


Module: Mesa
Branch: master
Commit: e0ef4800f5deb81ed57dccf8ba39e01c12f4beff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e0ef4800f5deb81ed57dccf8ba39e01c12f4beff

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Fri Aug 20 00:18:30 2010 -0700

galahad, i915g: Copy over constant buffer index check.

---

 src/gallium/drivers/galahad/glhd_context.c |    9 +++++++++
 src/gallium/drivers/i915/i915_state.c      |    2 --
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
index 10e4679..383c448 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -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);
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index cbddb21..8c53b06 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -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.




More information about the mesa-commit mailing list