aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan/tu_shader.c
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2020-04-21 12:19:56 -0400
committerMarge Bot <[email protected]>2020-04-22 18:46:46 +0000
commit83b2f1d8cf53ec7f9defa2acdae313cdacb303af (patch)
treeaa5d1e3ca3795ceb4f48e1a6bb766ac9a6c8976a /src/freedreno/vulkan/tu_shader.c
parent36e0d2f39b0264e393fd4edab7c87d3e0d5454a4 (diff)
turnip: set shader key msaa field
Fixes per-sample interpolation. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4665>
Diffstat (limited to 'src/freedreno/vulkan/tu_shader.c')
-rw-r--r--src/freedreno/vulkan/tu_shader.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c
index 85bf6bbc50f..aa07f5df066 100644
--- a/src/freedreno/vulkan/tu_shader.c
+++ b/src/freedreno/vulkan/tu_shader.c
@@ -596,6 +596,7 @@ tu_shader_compile_options_init(
const VkGraphicsPipelineCreateInfo *pipeline_info)
{
bool has_gs = false;
+ bool msaa = false;
if (pipeline_info) {
for (uint32_t i = 0; i < pipeline_info->stageCount; i++) {
if (pipeline_info->pStages[i].stage == VK_SHADER_STAGE_GEOMETRY_BIT) {
@@ -603,12 +604,17 @@ tu_shader_compile_options_init(
break;
}
}
+
+ if (!pipeline_info->pRasterizationState->rasterizerDiscardEnable &&
+ pipeline_info->pMultisampleState->rasterizationSamples > 1)
+ msaa = true;
}
*options = (struct tu_shader_compile_options) {
/* TODO: Populate the remaining fields of ir3_shader_key. */
.key = {
.has_gs = has_gs,
+ .msaa = msaa,
},
/* TODO: VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT
* some optimizations need to happen otherwise shader might not compile