ir3: fix output_loc size

It was off-by-one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>
This commit is contained in:
Chia-I Wu 2022-07-22 18:17:44 -07:00 committed by Marge Bot
parent 9c106f3ee7
commit 74c96af71d
2 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ struct state {
struct primitive_map {
/* +POSITION, +PSIZE, ... - see shader_io_get_unique_index */
unsigned loc[32 + 11];
unsigned loc[12 + 32];
unsigned stride;
} map;
@ -114,10 +114,10 @@ shader_io_get_unique_index(gl_varying_slot slot)
case VARYING_SLOT_VIEWPORT: return 11;
case VARYING_SLOT_VAR0 ... VARYING_SLOT_VAR31: {
struct state state = {};
STATIC_ASSERT(ARRAY_SIZE(state.map.loc) ==
STATIC_ASSERT(ARRAY_SIZE(state.map.loc) - 1 ==
(12 + VARYING_SLOT_VAR31 - VARYING_SLOT_VAR0));
struct ir3_shader_variant v = {};
STATIC_ASSERT(ARRAY_SIZE(v.output_loc) ==
STATIC_ASSERT(ARRAY_SIZE(v.output_loc) - 1 ==
(12 + VARYING_SLOT_VAR31 - VARYING_SLOT_VAR0));
return 12 + (slot - VARYING_SLOT_VAR0);
}

View File

@ -614,7 +614,7 @@ struct ir3_shader_variant {
* offset, and in bytes for all other stages.
* +POSITION, +PSIZE, ... - see shader_io_get_unique_index
*/
unsigned output_loc[32 + 11];
unsigned output_loc[12 + 32];
/* attributes (VS) / varyings (FS):
* Note that sysval's should come *after* normal inputs.