diff options
| author | 2022-12-28 20:59:23 -0500 | |
|---|---|---|
| committer | 2022-12-28 20:59:23 -0500 | |
| commit | 9fdacb5e3a03928a5671670d0db1e0058daf344e (patch) | |
| tree | 286cf97c02dc915ba828da1f6a0fa4dc5440e795 /src/video_core/host_shaders | |
| parent | Merge pull request #9504 from liamwhite/pg2 (diff) | |
| parent | video_core: Implement other missing vulkan topology (diff) | |
| download | yuzu-9fdacb5e3a03928a5671670d0db1e0058daf344e.tar.gz yuzu-9fdacb5e3a03928a5671670d0db1e0058daf344e.tar.xz yuzu-9fdacb5e3a03928a5671670d0db1e0058daf344e.zip | |
Merge pull request #9423 from vonchenplus/vulkan_quad_strip
video_core: Implement all vulkan topology
Diffstat (limited to 'src/video_core/host_shaders')
| -rw-r--r-- | src/video_core/host_shaders/vulkan_quad_indexed.comp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/host_shaders/vulkan_quad_indexed.comp b/src/video_core/host_shaders/vulkan_quad_indexed.comp index a412f30ff..066fe4a9c 100644 --- a/src/video_core/host_shaders/vulkan_quad_indexed.comp +++ b/src/video_core/host_shaders/vulkan_quad_indexed.comp | |||
| @@ -16,6 +16,7 @@ layout (std430, set = 0, binding = 1) writeonly buffer OutputBuffer { | |||
| 16 | layout (push_constant) uniform PushConstants { | 16 | layout (push_constant) uniform PushConstants { |
| 17 | uint base_vertex; | 17 | uint base_vertex; |
| 18 | int index_shift; // 0: uint8, 1: uint16, 2: uint32 | 18 | int index_shift; // 0: uint8, 1: uint16, 2: uint32 |
| 19 | int is_strip; // 0: quads 1: quadstrip | ||
| 19 | }; | 20 | }; |
| 20 | 21 | ||
| 21 | void main() { | 22 | void main() { |
| @@ -28,9 +29,10 @@ void main() { | |||
| 28 | int flipped_shift = 2 - index_shift; | 29 | int flipped_shift = 2 - index_shift; |
| 29 | int mask = (1 << flipped_shift) - 1; | 30 | int mask = (1 << flipped_shift) - 1; |
| 30 | 31 | ||
| 31 | const int quad_swizzle[6] = int[](0, 1, 2, 0, 2, 3); | 32 | const int quads_swizzle[6] = int[](0, 1, 2, 0, 2, 3); |
| 33 | const int quad_strip_swizzle[6] = int[](0, 3, 1, 0, 2, 3); | ||
| 32 | for (uint vertex = 0; vertex < 6; ++vertex) { | 34 | for (uint vertex = 0; vertex < 6; ++vertex) { |
| 33 | int offset = primitive * 4 + quad_swizzle[vertex]; | 35 | int offset = (is_strip == 0 ? primitive * 4 + quads_swizzle[vertex] : primitive * 2 + quad_strip_swizzle[vertex]); |
| 34 | int int_offset = offset >> flipped_shift; | 36 | int int_offset = offset >> flipped_shift; |
| 35 | int bit_offset = (offset & mask) * index_size; | 37 | int bit_offset = (offset & mask) * index_size; |
| 36 | uint packed_input = input_indexes[int_offset]; | 38 | uint packed_input = input_indexes[int_offset]; |