galahad, i915g: Copy over constant buffer index check.

This commit is contained in:
Corbin Simpson 2010-08-20 00:18:30 -07:00
parent cdc1c67b98
commit e0ef4800f5
2 changed files with 9 additions and 2 deletions

View 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);

View 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.