diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2022-12-28 20:59:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-28 20:59:23 -0500 |
| commit | 9fdacb5e3a03928a5671670d0db1e0058daf344e (patch) | |
| tree | 286cf97c02dc915ba828da1f6a0fa4dc5440e795 /src/video_core/host_shaders | |
| parent | 60419dd35e8d6dec97ec12839b5b9910167315d2 (diff) | |
| parent | 6a397bc8eda2f239dd8823f342f164cc0fec9c41 (diff) | |
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 { layout (push_constant) uniform PushConstants { uint base_vertex; int index_shift; // 0: uint8, 1: uint16, 2: uint32 + int is_strip; // 0: quads 1: quadstrip }; void main() { @@ -28,9 +29,10 @@ void main() { int flipped_shift = 2 - index_shift; int mask = (1 << flipped_shift) - 1; - const int quad_swizzle[6] = int[](0, 1, 2, 0, 2, 3); + const int quads_swizzle[6] = int[](0, 1, 2, 0, 2, 3); + const int quad_strip_swizzle[6] = int[](0, 3, 1, 0, 2, 3); for (uint vertex = 0; vertex < 6; ++vertex) { - int offset = primitive * 4 + quad_swizzle[vertex]; + int offset = (is_strip == 0 ? primitive * 4 + quads_swizzle[vertex] : primitive * 2 + quad_strip_swizzle[vertex]); int int_offset = offset >> flipped_shift; int bit_offset = (offset & mask) * index_size; uint packed_input = input_indexes[int_offset]; |
