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:

committed by
Marge Bot

parent
4b62e90e71
commit
b47090c5b3
@@ -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,
|
.push_const_addr_format = nir_address_format_logical,
|
||||||
.shared_addr_format = nir_address_format_32bit_offset,
|
.shared_addr_format = nir_address_format_32bit_offset,
|
||||||
.constant_addr_format = nir_address_format_64bit_global,
|
.constant_addr_format = nir_address_format_64bit_global,
|
||||||
.frag_coord_is_sysval = true,
|
|
||||||
.use_deref_buffer_array_length = true,
|
.use_deref_buffer_array_length = true,
|
||||||
.debug =
|
.debug =
|
||||||
{
|
{
|
||||||
|
@@ -190,7 +190,6 @@ static const struct spirv_to_nir_options default_spirv_options = {
|
|||||||
.phys_ssbo_addr_format = nir_address_format_64bit_global,
|
.phys_ssbo_addr_format = nir_address_format_64bit_global,
|
||||||
.push_const_addr_format = nir_address_format_logical,
|
.push_const_addr_format = nir_address_format_logical,
|
||||||
.shared_addr_format = nir_address_format_32bit_offset,
|
.shared_addr_format = nir_address_format_32bit_offset,
|
||||||
.frag_coord_is_sysval = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const nir_shader_compiler_options v3dv_nir_options = {
|
const nir_shader_compiler_options v3dv_nir_options = {
|
||||||
|
@@ -58,11 +58,6 @@ enum nir_spirv_execution_environment {
|
|||||||
struct spirv_to_nir_options {
|
struct spirv_to_nir_options {
|
||||||
enum nir_spirv_execution_environment environment;
|
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.
|
/* Whether to keep ViewIndex as an input instead of rewriting to a sysval.
|
||||||
*/
|
*/
|
||||||
bool view_index_is_input;
|
bool view_index_is_input;
|
||||||
|
@@ -879,12 +879,8 @@ vtn_get_builtin_location(struct vtn_builder *b,
|
|||||||
break;
|
break;
|
||||||
case SpvBuiltInFragCoord:
|
case SpvBuiltInFragCoord:
|
||||||
vtn_assert(*mode == nir_var_shader_in);
|
vtn_assert(*mode == nir_var_shader_in);
|
||||||
if (b->options && b->options->frag_coord_is_sysval) {
|
*mode = nir_var_system_value;
|
||||||
*mode = nir_var_system_value;
|
*location = SYSTEM_VALUE_FRAG_COORD;
|
||||||
*location = SYSTEM_VALUE_FRAG_COORD;
|
|
||||||
} else {
|
|
||||||
*location = VARYING_SLOT_POS;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SpvBuiltInPointCoord:
|
case SpvBuiltInPointCoord:
|
||||||
*location = VARYING_SLOT_PNTC;
|
*location = VARYING_SLOT_PNTC;
|
||||||
|
@@ -38,8 +38,6 @@ tu_spirv_to_nir(struct tu_device *dev,
|
|||||||
{
|
{
|
||||||
/* TODO these are made-up */
|
/* TODO these are made-up */
|
||||||
const struct spirv_to_nir_options spirv_options = {
|
const struct spirv_to_nir_options spirv_options = {
|
||||||
.frag_coord_is_sysval = true,
|
|
||||||
|
|
||||||
.ubo_addr_format = nir_address_format_vec2_index_32bit_offset,
|
.ubo_addr_format = nir_address_format_vec2_index_32bit_offset,
|
||||||
.ssbo_addr_format = nir_address_format_vec2_index_32bit_offset,
|
.ssbo_addr_format = nir_address_format_vec2_index_32bit_offset,
|
||||||
|
|
||||||
|
@@ -514,7 +514,6 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
|
|||||||
.phys_ssbo_addr_format = nir_address_format_64bit_global,
|
.phys_ssbo_addr_format = nir_address_format_64bit_global,
|
||||||
.push_const_addr_format = nir_address_format_logical,
|
.push_const_addr_format = nir_address_format_logical,
|
||||||
.shared_addr_format = nir_address_format_32bit_offset,
|
.shared_addr_format = nir_address_format_32bit_offset,
|
||||||
.frag_coord_is_sysval = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nir = spirv_to_nir(spirv, module->size / 4,
|
nir = spirv_to_nir(spirv, module->size / 4,
|
||||||
|
@@ -108,7 +108,6 @@ anv_shader_compile_to_nir(struct anv_device *device,
|
|||||||
.module = module,
|
.module = module,
|
||||||
};
|
};
|
||||||
struct spirv_to_nir_options spirv_options = {
|
struct spirv_to_nir_options spirv_options = {
|
||||||
.frag_coord_is_sysval = true,
|
|
||||||
.caps = {
|
.caps = {
|
||||||
.demote_to_helper_invocation = true,
|
.demote_to_helper_invocation = true,
|
||||||
.derivative_group = true,
|
.derivative_group = true,
|
||||||
|
@@ -243,7 +243,6 @@ _mesa_spirv_to_nir(struct gl_context *ctx,
|
|||||||
|
|
||||||
const struct spirv_to_nir_options spirv_options = {
|
const struct spirv_to_nir_options spirv_options = {
|
||||||
.environment = NIR_SPIRV_OPENGL,
|
.environment = NIR_SPIRV_OPENGL,
|
||||||
.frag_coord_is_sysval = ctx->Const.GLSLFragCoordIsSysVal,
|
|
||||||
.use_deref_buffer_array_length = true,
|
.use_deref_buffer_array_length = true,
|
||||||
.caps = ctx->Const.SpirVCapabilities,
|
.caps = ctx->Const.SpirVCapabilities,
|
||||||
.ubo_addr_format = nir_address_format_32bit_index_offset,
|
.ubo_addr_format = nir_address_format_32bit_index_offset,
|
||||||
|
Reference in New Issue
Block a user