mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
zink: handle bitsizes in get_bo_vars() analysis
this allows it to be run repeatedly Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17239>
This commit is contained in:
parent
58780b3aa6
commit
ac2141a5b2
1 changed files with 7 additions and 6 deletions
|
|
@ -485,16 +485,17 @@ get_bo_vars(struct zink_shader *zs, nir_shader *shader)
|
|||
bo.first_ssbo = ffs(zs->ssbos_used) - 1;
|
||||
assert(bo.first_ssbo < PIPE_MAX_SHADER_BUFFERS);
|
||||
nir_foreach_variable_with_modes(var, shader, nir_var_mem_ssbo | nir_var_mem_ubo) {
|
||||
unsigned idx = glsl_get_explicit_stride(glsl_get_struct_field(glsl_without_array(var->type), 0)) >> 1;
|
||||
if (var->data.mode == nir_var_mem_ssbo) {
|
||||
assert(!bo.ssbo[32 >> 4]);
|
||||
bo.ssbo[32 >> 4] = var;
|
||||
assert(!bo.ssbo[idx]);
|
||||
bo.ssbo[idx] = var;
|
||||
} else {
|
||||
if (var->data.driver_location) {
|
||||
assert(!bo.ubo[32 >> 4]);
|
||||
bo.ubo[32 >> 4] = var;
|
||||
assert(!bo.ubo[idx]);
|
||||
bo.ubo[idx] = var;
|
||||
} else {
|
||||
assert(!bo.uniforms[32 >> 4]);
|
||||
bo.uniforms[32 >> 4] = var;
|
||||
assert(!bo.uniforms[idx]);
|
||||
bo.uniforms[idx] = var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue