spirv: Always declare FragCoord as a sysval

Now that all spirv_to_nir() users take care of converting sysvals to
varyings, we can unconditionally declare FragCoord as a sysval.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>
This commit is contained in:
Boris Brezillon 2021-09-27 15:16:43 +02:00 committed by Marge Bot
parent 4b62e90e71
commit b47090c5b3
8 changed files with 2 additions and 18 deletions

View File

@ -521,7 +521,6 @@ radv_shader_compile_to_nir(struct radv_device *device, struct vk_shader_module *
.push_const_addr_format = nir_address_format_logical,
.shared_addr_format = nir_address_format_32bit_offset,
.constant_addr_format = nir_address_format_64bit_global,
.frag_coord_is_sysval = true,
.use_deref_buffer_array_length = true,
.debug =
{

View File

@ -190,7 +190,6 @@ static const struct spirv_to_nir_options default_spirv_options = {
.phys_ssbo_addr_format = nir_address_format_64bit_global,
.push_const_addr_format = nir_address_format_logical,
.shared_addr_format = nir_address_format_32bit_offset,
.frag_coord_is_sysval = false,
};
const nir_shader_compiler_options v3dv_nir_options = {

View File

@ -58,11 +58,6 @@ enum nir_spirv_execution_environment {
struct spirv_to_nir_options {
enum nir_spirv_execution_environment environment;
/* Whether to make FragCoord to a system value, the same as
* GLSLFragCoordIsSysVal in GLSL.
*/
bool frag_coord_is_sysval;
/* Whether to keep ViewIndex as an input instead of rewriting to a sysval.
*/
bool view_index_is_input;

View File

@ -879,12 +879,8 @@ vtn_get_builtin_location(struct vtn_builder *b,
break;
case SpvBuiltInFragCoord:
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;
}
*mode = nir_var_system_value;
*location = SYSTEM_VALUE_FRAG_COORD;
break;
case SpvBuiltInPointCoord:
*location = VARYING_SLOT_PNTC;

View File

@ -38,8 +38,6 @@ tu_spirv_to_nir(struct tu_device *dev,
{
/* TODO these are made-up */
const struct spirv_to_nir_options spirv_options = {
.frag_coord_is_sysval = true,
.ubo_addr_format = nir_address_format_vec2_index_32bit_offset,
.ssbo_addr_format = nir_address_format_vec2_index_32bit_offset,

View File

@ -514,7 +514,6 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
.phys_ssbo_addr_format = nir_address_format_64bit_global,
.push_const_addr_format = nir_address_format_logical,
.shared_addr_format = nir_address_format_32bit_offset,
.frag_coord_is_sysval = false,
};
nir = spirv_to_nir(spirv, module->size / 4,

View File

@ -108,7 +108,6 @@ anv_shader_compile_to_nir(struct anv_device *device,
.module = module,
};
struct spirv_to_nir_options spirv_options = {
.frag_coord_is_sysval = true,
.caps = {
.demote_to_helper_invocation = true,
.derivative_group = true,

View File

@ -243,7 +243,6 @@ _mesa_spirv_to_nir(struct gl_context *ctx,
const struct spirv_to_nir_options spirv_options = {
.environment = NIR_SPIRV_OPENGL,
.frag_coord_is_sysval = ctx->Const.GLSLFragCoordIsSysVal,
.use_deref_buffer_array_length = true,
.caps = ctx->Const.SpirVCapabilities,
.ubo_addr_format = nir_address_format_32bit_index_offset,