nir: fix slot calculations for compact variables with location_frac
a variable with a component offset may span multiple slots, and this cannot be inferred from its type alone (e.g., compacted clip+cull distances) cc: mesa-stable Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24163>
This commit is contained in:

committed by
Marge Bot

parent
42021b4d13
commit
59396eefe6
@@ -72,7 +72,7 @@ fs_visitor::nir_setup_outputs()
|
||||
nir_foreach_shader_out_variable(var, nir) {
|
||||
const int loc = var->data.driver_location;
|
||||
const unsigned var_vec4s =
|
||||
var->data.compact ? DIV_ROUND_UP(glsl_get_length(var->type), 4)
|
||||
var->data.compact ? DIV_ROUND_UP(var->data.location_frac + glsl_get_length(var->type), 4)
|
||||
: type_size_vec4(var->type, true);
|
||||
vec4s[loc] = MAX2(vec4s[loc], var_vec4s);
|
||||
}
|
||||
|
Reference in New Issue
Block a user