mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
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.
This commit is contained in:
parent
91d8409649
commit
8c28a9bd73
1 changed files with 8 additions and 2 deletions
|
|
@ -370,6 +370,11 @@ validate_program(struct i915_context *i915, unsigned *batch_space)
|
||||||
{
|
{
|
||||||
uint additional_size = 0;
|
uint additional_size = 0;
|
||||||
|
|
||||||
|
if (!i915->fs->program_len) {
|
||||||
|
*batch_space = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
additional_size += i915->current.target_fixup_format ? 3 : 0;
|
additional_size += i915->current.target_fixup_format ? 3 : 0;
|
||||||
|
|
||||||
/* we need more batch space if we want to emulate rgba framebuffers */
|
/* 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 additional_size = 0;
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
|
if (!i915->fs->program_len)
|
||||||
|
return;
|
||||||
|
|
||||||
/* count how much additional space we'll need */
|
/* count how much additional space we'll need */
|
||||||
validate_program(i915, &additional_size);
|
validate_program(i915, &additional_size);
|
||||||
additional_size -= i915->fs->decl_len + i915->fs->program_len;
|
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 */
|
/* output the declarations */
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue