summaryrefslogtreecommitdiffstats
path: root/src/video_core/host_shaders
diff options
context:
space:
mode:
authorFengChen <vonchenplus@gmail.com>2022-12-12 15:17:33 +0100
committerFengChen <vonchenplus@gmail.com>2022-12-26 04:37:34 +0100
commit86d5b4e556072e86b9af3ac8a4ef6842a8d9df67 (patch)
tree238ea02d1aba2663e5a94ae5664812290b2a6326 /src/video_core/host_shaders
parentMerge pull request #9420 from liamwhite/aniso (diff)
downloadyuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar
yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar.gz
yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar.bz2
yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar.lz
yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar.xz
yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.tar.zst
yuzu-86d5b4e556072e86b9af3ac8a4ef6842a8d9df67.zip
Diffstat (limited to 'src/video_core/host_shaders')
-rw-r--r--src/video_core/host_shaders/vulkan_quad_indexed.comp6
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];