Module: Mesa Branch: main Commit: 74a24f4f1c8b0f97adc0d3e1ea8c909f5d8bb6f4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=74a24f4f1c8b0f97adc0d3e1ea8c909f5d8bb6f4
Author: Michael Tang <[email protected]> Date: Mon Aug 23 18:53:28 2021 -0700 microsoft/compiler: Set the SampleFrequency runtime metadata Reviewed-by: Jesse Natalie <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12513> --- src/microsoft/compiler/dxil_module.h | 1 + src/microsoft/compiler/dxil_signature.c | 5 +++++ src/microsoft/compiler/nir_to_dxil.c | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/microsoft/compiler/dxil_module.h b/src/microsoft/compiler/dxil_module.h index e5698600eb7..217087dda19 100644 --- a/src/microsoft/compiler/dxil_module.h +++ b/src/microsoft/compiler/dxil_module.h @@ -159,6 +159,7 @@ struct dxil_features { struct dxil_shader_info { unsigned has_out_position:1; unsigned has_out_depth:1; + unsigned has_per_sample_input:1; }; struct dxil_module { diff --git a/src/microsoft/compiler/dxil_signature.c b/src/microsoft/compiler/dxil_signature.c index 895ec30a848..61f16ba4f7a 100644 --- a/src/microsoft/compiler/dxil_signature.c +++ b/src/microsoft/compiler/dxil_signature.c @@ -492,6 +492,11 @@ get_input_signature_group(struct dxil_module *mod, const struct dxil_mdnode **in mod->num_psv_inputs = MAX2(mod->num_psv_inputs, semantic.start_row + semantic.rows); + mod->info.has_per_sample_input |= + semantic.kind == DXIL_SEM_SAMPLE_INDEX || + semantic.interpolation == DXIL_INTERP_LINEAR_SAMPLE || + semantic.interpolation == DXIL_INTERP_LINEAR_NOPERSPECTIVE_SAMPLE; + ++num_inputs; assert(num_inputs < VARYING_SLOT_MAX); } diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 972000171ef..3601c8290e5 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -4711,9 +4711,9 @@ void dxil_fill_validation_state(struct ntd_context *ctx, break; case DXIL_PIXEL_SHADER: /* TODO: handle depth outputs */ - state->state.psv0.ps.depth_output = ctx->mod.info.has_out_depth; - /* just guessing */ - state->state.psv0.ps.sample_frequency = 0; + state->state.psv0.ps.depth_output = ctx->mod.info.has_out_depth; + state->state.psv0.ps.sample_frequency = + ctx->mod.info.has_per_sample_input; break; case DXIL_COMPUTE_SHADER: break;
