summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-04-14 06:32:18 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:27 +0200
commit6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb (patch)
tree600283ca680de2c1efc2fd14bd24ca9862ccf125 /src/video_core/renderer_vulkan
parentshader: Implement transform feedbacks and define file format (diff)
downloadyuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar
yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar.gz
yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar.bz2
yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar.lz
yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar.xz
yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar.zst
yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index de52d0f30..80f196d0e 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -492,6 +492,37 @@ private:
u32 read_lowest{};
u32 read_highest{};
};
+
+Shader::CompareFunction MaxwellToCompareFunction(Maxwell::ComparisonOp comparison) {
+ switch (comparison) {
+ case Maxwell::ComparisonOp::Never:
+ case Maxwell::ComparisonOp::NeverOld:
+ return Shader::CompareFunction::Never;
+ case Maxwell::ComparisonOp::Less:
+ case Maxwell::ComparisonOp::LessOld:
+ return Shader::CompareFunction::Less;
+ case Maxwell::ComparisonOp::Equal:
+ case Maxwell::ComparisonOp::EqualOld:
+ return Shader::CompareFunction::Equal;
+ case Maxwell::ComparisonOp::LessEqual:
+ case Maxwell::ComparisonOp::LessEqualOld:
+ return Shader::CompareFunction::LessThanEqual;
+ case Maxwell::ComparisonOp::Greater:
+ case Maxwell::ComparisonOp::GreaterOld:
+ return Shader::CompareFunction::Greater;
+ case Maxwell::ComparisonOp::NotEqual:
+ case Maxwell::ComparisonOp::NotEqualOld:
+ return Shader::CompareFunction::NotEqual;
+ case Maxwell::ComparisonOp::GreaterEqual:
+ case Maxwell::ComparisonOp::GreaterEqualOld:
+ return Shader::CompareFunction::GreaterThanEqual;
+ case Maxwell::ComparisonOp::Always:
+ case Maxwell::ComparisonOp::AlwaysOld:
+ return Shader::CompareFunction::Always;
+ }
+ UNIMPLEMENTED_MSG("Unimplemented comparison op={}", comparison);
+ return {};
+}
} // Anonymous namespace
void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
@@ -1016,6 +1047,11 @@ Shader::Profile PipelineCache::MakeProfile(const GraphicsPipelineCacheKey& key,
}
profile.convert_depth_mode = gl_ndc;
break;
+ case Shader::Stage::Fragment:
+ profile.alpha_test_func = MaxwellToCompareFunction(
+ key.state.UnpackComparisonOp(key.state.alpha_test_func.Value()));
+ profile.alpha_test_reference = Common::BitCast<float>(key.state.alpha_test_ref);
+ break;
default:
break;
}