diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index e1a956843ec..9cde5ca1f9b 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -2044,7 +2044,9 @@ adjust_patch_locations(struct vtn_builder *b, struct vtn_variable *var) for (uint16_t i = 0; i < num_data; i++) { vtn_assert(data[i].location < VARYING_SLOT_PATCH0); - if (data[i].patch && data[i].location >= VARYING_SLOT_VAR0) + if (data[i].patch && + (data[i].mode == nir_var_shader_in || data[i].mode == nir_var_shader_out) && + data[i].location >= VARYING_SLOT_VAR0) data[i].location += VARYING_SLOT_PATCH0 - VARYING_SLOT_VAR0; } }