diff options
| author | 2019-07-15 16:28:07 -0400 | |
|---|---|---|
| committer | 2019-07-15 16:28:07 -0400 | |
| commit | 1bdb59fc6e52ac9d2c2432511fe7524994cc4f55 (patch) | |
| tree | bcef764c59b000dba9eb040281799bf0152cb363 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #2705 from FernandoS27/tex-cache-fixes (diff) | |
| parent | gl_shader_decompiler: Fix gl_PointSize redeclaration (diff) | |
| download | yuzu-1bdb59fc6e52ac9d2c2432511fe7524994cc4f55.tar.gz yuzu-1bdb59fc6e52ac9d2c2432511fe7524994cc4f55.tar.xz yuzu-1bdb59fc6e52ac9d2c2432511fe7524994cc4f55.zip | |
Merge pull request #2695 from ReinUsesLisp/layer-viewport
gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shaders
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 1bb04607b..9b2d8e987 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |||
| @@ -430,20 +430,17 @@ private: | |||
| 430 | instance_index = DeclareBuiltIn(spv::BuiltIn::InstanceIndex, spv::StorageClass::Input, | 430 | instance_index = DeclareBuiltIn(spv::BuiltIn::InstanceIndex, spv::StorageClass::Input, |
| 431 | t_in_uint, "instance_index"); | 431 | t_in_uint, "instance_index"); |
| 432 | 432 | ||
| 433 | bool is_point_size_declared = false; | ||
| 434 | bool is_clip_distances_declared = false; | 433 | bool is_clip_distances_declared = false; |
| 435 | for (const auto index : ir.GetOutputAttributes()) { | 434 | for (const auto index : ir.GetOutputAttributes()) { |
| 436 | if (index == Attribute::Index::PointSize) { | 435 | if (index == Attribute::Index::ClipDistances0123 || |
| 437 | is_point_size_declared = true; | 436 | index == Attribute::Index::ClipDistances4567) { |
| 438 | } else if (index == Attribute::Index::ClipDistances0123 || | ||
| 439 | index == Attribute::Index::ClipDistances4567) { | ||
| 440 | is_clip_distances_declared = true; | 437 | is_clip_distances_declared = true; |
| 441 | } | 438 | } |
| 442 | } | 439 | } |
| 443 | 440 | ||
| 444 | std::vector<Id> members; | 441 | std::vector<Id> members; |
| 445 | members.push_back(t_float4); | 442 | members.push_back(t_float4); |
| 446 | if (is_point_size_declared) { | 443 | if (ir.UsesPointSize()) { |
| 447 | members.push_back(t_float); | 444 | members.push_back(t_float); |
| 448 | } | 445 | } |
| 449 | if (is_clip_distances_declared) { | 446 | if (is_clip_distances_declared) { |
| @@ -466,7 +463,7 @@ private: | |||
| 466 | 463 | ||
| 467 | position_index = MemberDecorateBuiltIn(spv::BuiltIn::Position, "position", true); | 464 | position_index = MemberDecorateBuiltIn(spv::BuiltIn::Position, "position", true); |
| 468 | point_size_index = | 465 | point_size_index = |
| 469 | MemberDecorateBuiltIn(spv::BuiltIn::PointSize, "point_size", is_point_size_declared); | 466 | MemberDecorateBuiltIn(spv::BuiltIn::PointSize, "point_size", ir.UsesPointSize()); |
| 470 | clip_distances_index = MemberDecorateBuiltIn(spv::BuiltIn::ClipDistance, "clip_distances", | 467 | clip_distances_index = MemberDecorateBuiltIn(spv::BuiltIn::ClipDistance, "clip_distances", |
| 471 | is_clip_distances_declared); | 468 | is_clip_distances_declared); |
| 472 | 469 | ||
| @@ -712,7 +709,8 @@ private: | |||
| 712 | case Attribute::Index::Position: | 709 | case Attribute::Index::Position: |
| 713 | return AccessElement(t_out_float, per_vertex, position_index, | 710 | return AccessElement(t_out_float, per_vertex, position_index, |
| 714 | abuf->GetElement()); | 711 | abuf->GetElement()); |
| 715 | case Attribute::Index::PointSize: | 712 | case Attribute::Index::LayerViewportPointSize: |
| 713 | UNIMPLEMENTED_IF(abuf->GetElement() != 3); | ||
| 716 | return AccessElement(t_out_float, per_vertex, point_size_index); | 714 | return AccessElement(t_out_float, per_vertex, point_size_index); |
| 717 | case Attribute::Index::ClipDistances0123: | 715 | case Attribute::Index::ClipDistances0123: |
| 718 | return AccessElement(t_out_float, per_vertex, clip_distances_index, | 716 | return AccessElement(t_out_float, per_vertex, clip_distances_index, |