spirv: Add an option for making FragCoord a sysval
On AMD, FragCoord should be a sysval because it is handled separately from all the other inputs. We were already doing this in radeonsi, but we weren't doing it with radv. It'll be much more annoying to handle VARYING_SLOT_POS in fragment shaders when we let NIR lower FS inputs for us, so here we add an option so that radv can get it as a system value. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -1295,8 +1295,13 @@ vtn_get_builtin_location(struct vtn_builder *b,
|
||||
set_mode_system_value(b, mode);
|
||||
break;
|
||||
case SpvBuiltInFragCoord:
|
||||
*location = VARYING_SLOT_POS;
|
||||
vtn_assert(*mode == nir_var_shader_in);
|
||||
if (b->options && b->options->frag_coord_is_sysval) {
|
||||
*mode = nir_var_system_value;
|
||||
*location = SYSTEM_VALUE_FRAG_COORD;
|
||||
} else {
|
||||
*location = VARYING_SLOT_POS;
|
||||
}
|
||||
break;
|
||||
case SpvBuiltInPointCoord:
|
||||
*location = VARYING_SLOT_PNTC;
|
||||
|
Reference in New Issue
Block a user