microsoft/spirv_to_dxil: Allow forcing per-sample shading

Needed to support VkPipelineMultisampleStateCreateInfo::sampleShadingEnable.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15916>
This commit is contained in:
Boris Brezillon 2022-04-13 02:14:36 -07:00 committed by Marge Bot
parent cacc3f03e6
commit 80a5deee62
2 changed files with 10 additions and 0 deletions

View file

@ -565,6 +565,13 @@ spirv_to_dxil(const uint32_t *words, size_t word_count,
NIR_PASS_V(nir, nir_lower_system_values);
// Force sample-rate shading if we're asked to.
if (conf->force_sample_rate_shading) {
assert(stage == MESA_SHADER_FRAGMENT);
nir_foreach_shader_in_variable(var, nir)
var->data.sample = true;
}
if (conf->zero_based_vertex_instance_id) {
// vertex_id and instance_id should have already been transformed to
// base zero before spirv_to_dxil was called. Therefore, we can zero out

View file

@ -165,6 +165,9 @@ struct dxil_spirv_runtime_conf {
// The caller supports read-only images to be turned into SRV accesses,
// which allows us to run the nir_opt_access() pass
bool read_only_images_as_srvs;
// Force sample rate shading on a fragment shader
bool force_sample_rate_shading;
};
struct dxil_spirv_debug_options {