diff options
| author | 2022-12-12 22:17:33 +0800 | |
|---|---|---|
| committer | 2022-12-26 11:37:34 +0800 | |
| commit | 86d5b4e556072e86b9af3ac8a4ef6842a8d9df67 (patch) | |
| tree | 238ea02d1aba2663e5a94ae5664812290b2a6326 /src/video_core/host_shaders | |
| parent | Merge pull request #9420 from liamwhite/aniso (diff) | |
| download | yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar.gz yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar.xz yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.zip | |
video_core: Implement vulkan QuadStrip 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]; |