diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 1dae574d837..59974cbe2e5 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2025,6 +2025,7 @@ typedef struct nir_io_semantics { unsigned num_slots : 6; /* max 32, may be pessimistic with const indexing */ unsigned dual_source_blend_index : 1; unsigned fb_fetch_output : 1; /* for GL_KHR_blend_equation_advanced */ + unsigned fb_fetch_output_coherent : 1; unsigned gs_streams : 8; /* xxyyzzww: 2-bit stream index for each component */ unsigned medium_precision : 1; /* GLSL mediump qualifier */ unsigned per_view : 1; @@ -2042,7 +2043,6 @@ typedef struct nir_io_semantics { unsigned no_sysval_output : 1; /* whether this system value output has no effect due to current pipeline states */ unsigned interp_explicit_strict : 1; /* preserve original vertex order */ - unsigned _pad : 1; } nir_io_semantics; /* Transform feedback info for 2 outputs. nir_intrinsic_store_output contains diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 86cc1d9cd95..2b4082851b3 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -389,6 +389,10 @@ emit_load(struct lower_io_state *state, semantics.location = var->data.location; semantics.num_slots = get_number_of_slots(state, var); semantics.fb_fetch_output = var->data.fb_fetch_output; + if (semantics.fb_fetch_output) { + semantics.fb_fetch_output_coherent = + !!(var->data.access & ACCESS_COHERENT); + } semantics.medium_precision = is_medium_precision(b->shader, var); semantics.high_dvec2 = high_dvec2; /* "per_vertex" is misnamed. It means "explicit interpolation with diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 7eab3b5ee5c..b2988830e32 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -1395,6 +1395,9 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state) if (io.fb_fetch_output) fprintf(fp, " fbfetch"); + if (io.fb_fetch_output_coherent) + fprintf(fp, " coherent"); + if (io.per_view) fprintf(fp, " perview"); diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index ee2c9cd32c4..815dd634df0 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -789,7 +789,8 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state) state->shader->info.stage == MESA_SHADER_TESS_CTRL); validate_assert(state, (!sem.dual_source_blend_index && - !sem.fb_fetch_output) || + !sem.fb_fetch_output && + !sem.fb_fetch_output_coherent) || state->shader->info.stage == MESA_SHADER_FRAGMENT); validate_assert(state, !sem.gs_streams ||