diff options
| author | 2021-04-14 00:32:18 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:27 -0400 | |
| commit | 6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb (patch) | |
| tree | 600283ca680de2c1efc2fd14bd24ca9862ccf125 /src/video_core | |
| parent | shader: Implement transform feedbacks and define file format (diff) | |
| download | yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar.gz yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.tar.xz yuzu-6c512f4bffde6bd8e4dbc74ed27cc84cd7fffadb.zip | |
spirv: Implement alpha test
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 36 |
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: | |||
| 492 | u32 read_lowest{}; | 492 | u32 read_lowest{}; |
| 493 | u32 read_highest{}; | 493 | u32 read_highest{}; |
| 494 | }; | 494 | }; |
| 495 | |||
| 496 | Shader::CompareFunction MaxwellToCompareFunction(Maxwell::ComparisonOp comparison) { | ||
| 497 | switch (comparison) { | ||
| 498 | case Maxwell::ComparisonOp::Never: | ||
| 499 | case Maxwell::ComparisonOp::NeverOld: | ||
| 500 | return Shader::CompareFunction::Never; | ||
| 501 | case Maxwell::ComparisonOp::Less: | ||
| 502 | case Maxwell::ComparisonOp::LessOld: | ||
| 503 | return Shader::CompareFunction::Less; | ||
| 504 | case Maxwell::ComparisonOp::Equal: | ||
| 505 | case Maxwell::ComparisonOp::EqualOld: | ||
| 506 | return Shader::CompareFunction::Equal; | ||
| 507 | case Maxwell::ComparisonOp::LessEqual: | ||
| 508 | case Maxwell::ComparisonOp::LessEqualOld: | ||
| 509 | return Shader::CompareFunction::LessThanEqual; | ||
| 510 | case Maxwell::ComparisonOp::Greater: | ||
| 511 | case Maxwell::ComparisonOp::GreaterOld: | ||
| 512 | return Shader::CompareFunction::Greater; | ||
| 513 | case Maxwell::ComparisonOp::NotEqual: | ||
| 514 | case Maxwell::ComparisonOp::NotEqualOld: | ||
| 515 | return Shader::CompareFunction::NotEqual; | ||
| 516 | case Maxwell::ComparisonOp::GreaterEqual: | ||
| 517 | case Maxwell::ComparisonOp::GreaterEqualOld: | ||
| 518 | return Shader::CompareFunction::GreaterThanEqual; | ||
| 519 | case Maxwell::ComparisonOp::Always: | ||
| 520 | case Maxwell::ComparisonOp::AlwaysOld: | ||
| 521 | return Shader::CompareFunction::Always; | ||
| 522 | } | ||
| 523 | UNIMPLEMENTED_MSG("Unimplemented comparison op={}", comparison); | ||
| 524 | return {}; | ||
| 525 | } | ||
| 495 | } // Anonymous namespace | 526 | } // Anonymous namespace |
| 496 | 527 | ||
| 497 | void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading, | 528 | void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading, |
| @@ -1016,6 +1047,11 @@ Shader::Profile PipelineCache::MakeProfile(const GraphicsPipelineCacheKey& key, | |||
| 1016 | } | 1047 | } |
| 1017 | profile.convert_depth_mode = gl_ndc; | 1048 | profile.convert_depth_mode = gl_ndc; |
| 1018 | break; | 1049 | break; |
| 1050 | case Shader::Stage::Fragment: | ||
| 1051 | profile.alpha_test_func = MaxwellToCompareFunction( | ||
| 1052 | key.state.UnpackComparisonOp(key.state.alpha_test_func.Value())); | ||
| 1053 | profile.alpha_test_reference = Common::BitCast<float>(key.state.alpha_test_ref); | ||
| 1054 | break; | ||
| 1019 | default: | 1055 | default: |
| 1020 | break; | 1056 | break; |
| 1021 | } | 1057 | } |