diff options
author | Stéphane Marchesin <[email protected]> | 2012-10-03 21:06:56 -0700 |
---|---|---|
committer | Stéphane Marchesin <[email protected]> | 2012-10-04 12:39:06 -0700 |
commit | 8c28a9bd733f5b51ab459c6bc626a5aaac5a6c0c (patch) | |
tree | aedf0ae173cc0481a52948caedc945bd8cee388e /src/gallium/drivers/i915 | |
parent | 91d84096497ff538f55591f7e6bb0b563726db8d (diff) |
i915g: Don't bind 0-length programs
Since we started doing fixups for different render target formats,
this has been an issue. Instead just don't do anything, when the
program gets emitted later it'll get the correct fixup.
Fixes a bunch of piglit tests.
Diffstat (limited to 'src/gallium/drivers/i915')
-rw-r--r-- | src/gallium/drivers/i915/i915_state_emit.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index 590a1baa420..7b4b02ee620 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -370,6 +370,11 @@ validate_program(struct i915_context *i915, unsigned *batch_space) { uint additional_size = 0; + if (!i915->fs->program_len) { + *batch_space = 0; + return; + } + additional_size += i915->current.target_fixup_format ? 3 : 0; /* we need more batch space if we want to emulate rgba framebuffers */ @@ -382,12 +387,13 @@ emit_program(struct i915_context *i915) uint additional_size = 0; uint i; + if (!i915->fs->program_len) + return; + /* count how much additional space we'll need */ validate_program(i915, &additional_size); additional_size -= i915->fs->decl_len + i915->fs->program_len; - /* we should always have, at least, a pass-through program */ - assert(i915->fs->program_len > 0); /* output the declarations */ { |