mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-24 10:38:11 +02:00
nir: change nir_frag_coord_form options to a bitmask
this makes it easier to add more options Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
This commit is contained in:
parent
7f5a307c12
commit
2d8d200c70
2 changed files with 9 additions and 9 deletions
|
|
@ -809,7 +809,7 @@ nir_build_frag_coord(nir_builder *b, unsigned num_components)
|
|||
assert(b->shader->info.stage == MESA_SHADER_FRAGMENT);
|
||||
assert(num_components && num_components <= 4);
|
||||
|
||||
if (b->shader->options->frag_coord_form >= nir_frag_coord_xy_z_w_separate) {
|
||||
if (b->shader->options->frag_coord_form & nir_frag_coord_xy_z_w_separate) {
|
||||
nir_def *xy = nir_load_frag_coord_xy(b);
|
||||
|
||||
if (num_components <= 2)
|
||||
|
|
@ -822,8 +822,7 @@ nir_build_frag_coord(nir_builder *b, unsigned num_components)
|
|||
|
||||
nir_def *w;
|
||||
|
||||
if (b->shader->options->frag_coord_form ==
|
||||
nir_frag_coord_xy_z_w_rcp_separate)
|
||||
if (b->shader->options->frag_coord_form & nir_frag_coord_use_w_rcp)
|
||||
w = nir_frcp(b, nir_load_frag_coord_w_rcp(b));
|
||||
else
|
||||
w = nir_load_frag_coord_w(b);
|
||||
|
|
|
|||
|
|
@ -244,12 +244,13 @@ typedef enum {
|
|||
} nir_lower_packing_op;
|
||||
|
||||
typedef enum {
|
||||
/* Build: frag_coord */
|
||||
nir_frag_coord_regular,
|
||||
/* Build: frag_coord_xy, frag_coord_z, frag_coord_w */
|
||||
nir_frag_coord_xy_z_w_separate,
|
||||
/* Build: frag_coord_xy, frag_coord_z, frcp(frag_coord_w_rcp) */
|
||||
nir_frag_coord_xy_z_w_rcp_separate,
|
||||
/* When set: use frag_coord_xy, frag_coord_z, frag_coord_w
|
||||
* When unset: use frag_coord
|
||||
*/
|
||||
nir_frag_coord_xy_z_w_separate = BITFIELD_BIT(0),
|
||||
|
||||
/* Use frag_coord_w_rcp instead of frag_coord_w. */
|
||||
nir_frag_coord_use_w_rcp = BITFIELD_BIT(1),
|
||||
} nir_frag_coord_form;
|
||||
|
||||
typedef struct nir_shader_compiler_options {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue