iris: null for non-existent cbufs

prevents BTs from being shifted down incorrectly
This commit is contained in:
Kenneth Graunke
2018-10-02 10:21:57 -07:00
parent 98e8f80e7d
commit 0d9c5b4e7e
3 changed files with 46 additions and 26 deletions

View File

@@ -532,6 +532,20 @@ iris_get_shader_info(const struct iris_context *ice, gl_shader_stage stage)
return &nir->info;
}
// XXX: this function is gross
unsigned
iris_get_shader_num_ubos(const struct iris_context *ice, gl_shader_stage stage)
{
const struct iris_uncompiled_shader *ish = ice->shaders.uncompiled[stage];
if (ish) {
const nir_shader *nir = ish->nir;
/* see assign_common_binding_table_offsets */
return nir->info.num_ubos + (nir->num_uniforms > 0 ? 1 : 0);
}
return 0;
}
/**
* Get the union of TCS output and TES input slots.
*