diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 403405dbee4..0d03981e6ff 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -680,6 +680,8 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader, case nir_intrinsic_load_invocation_id: case nir_intrinsic_load_frag_coord: case nir_intrinsic_load_pixel_coord: + case nir_intrinsic_load_frag_coord_z: + case nir_intrinsic_load_frag_coord_w: case nir_intrinsic_load_frag_shading_rate: case nir_intrinsic_load_fully_covered: case nir_intrinsic_load_point_coord: diff --git a/src/compiler/nir/nir_lower_frag_coord_to_pixel_coord.c b/src/compiler/nir/nir_lower_frag_coord_to_pixel_coord.c index c3d1d738fb0..0d96acdd595 100644 --- a/src/compiler/nir/nir_lower_frag_coord_to_pixel_coord.c +++ b/src/compiler/nir/nir_lower_frag_coord_to_pixel_coord.c @@ -18,9 +18,12 @@ lower(nir_builder *b, nir_intrinsic_instr *intr, UNUSED void *data) */ b->cursor = nir_before_instr(&intr->instr); nir_def *xy = nir_u2f32(b, nir_load_pixel_coord(b)); + BITSET_SET(b->shader->info.system_values_read, SYSTEM_VALUE_PIXEL_COORD); nir_def *vec = nir_vec4(b, nir_channel(b, xy, 0), nir_channel(b, xy, 1), nir_load_frag_coord_z(b), nir_load_frag_coord_w(b)); + BITSET_SET(b->shader->info.system_values_read, SYSTEM_VALUE_FRAG_COORD_Z); + BITSET_SET(b->shader->info.system_values_read, SYSTEM_VALUE_FRAG_COORD_W); nir_def_rewrite_uses(&intr->def, vec); return true; } diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c index 8a66700a1ef..578c9d166b6 100644 --- a/src/compiler/shader_enums.c +++ b/src/compiler/shader_enums.c @@ -328,6 +328,8 @@ gl_system_value_name(gl_system_value sysval) ENUM(SYSTEM_VALUE_INVOCATION_ID), ENUM(SYSTEM_VALUE_FRAG_COORD), ENUM(SYSTEM_VALUE_PIXEL_COORD), + ENUM(SYSTEM_VALUE_FRAG_COORD_Z), + ENUM(SYSTEM_VALUE_FRAG_COORD_W), ENUM(SYSTEM_VALUE_POINT_COORD), ENUM(SYSTEM_VALUE_LINE_COORD), ENUM(SYSTEM_VALUE_FRONT_FACE), diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h index 5e83bbe32d0..db6a3210e77 100644 --- a/src/compiler/shader_enums.h +++ b/src/compiler/shader_enums.h @@ -783,6 +783,8 @@ typedef enum /*@{*/ SYSTEM_VALUE_FRAG_COORD, SYSTEM_VALUE_PIXEL_COORD, + SYSTEM_VALUE_FRAG_COORD_Z, + SYSTEM_VALUE_FRAG_COORD_W, SYSTEM_VALUE_POINT_COORD, SYSTEM_VALUE_LINE_COORD, /**< Coord along axis perpendicular to line */ SYSTEM_VALUE_FRONT_FACE,