VERY experimental Nintendo Switch 2 emulator
C++
maxwell_to_vk: Use VK_EXT_index_type_uint8 when available
ReinUsesLisp4b22842a0736
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cppindex 7f0eb6b74f..5263dd768b 100644--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp@@ -308,11 +308,14 @@ vk::CompareOp ComparisonOp(Maxwell::ComparisonOp comparison) {return {};}-vk::IndexType IndexFormat(Maxwell::IndexFormat index_format) {+vk::IndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_format) {switch (index_format) {case Maxwell::IndexFormat::UnsignedByte:- UNIMPLEMENTED_MSG("Vulkan does not support native u8 index format");- return vk::IndexType::eUint16;+ if (!device.IsExtIndexTypeUint8Supported()) {+ UNIMPLEMENTED_MSG("Native uint8 indices are not supported on this device");+ return vk::IndexType::eUint16;+ }+ return vk::IndexType::eUint8EXT;case Maxwell::IndexFormat::UnsignedShort:return vk::IndexType::eUint16;case Maxwell::IndexFormat::UnsignedInt:diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.h b/src/video_core/renderer_vulkan/maxwell_to_vk.hindex 904a32e011..7dafdacf83 100644--- a/src/video_core/renderer_vulkan/maxwell_to_vk.h+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.h@@ -40,7 +40,7 @@ vk::Format VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttrvk::CompareOp ComparisonOp(Maxwell::ComparisonOp comparison);-vk::IndexType IndexFormat(Maxwell::IndexFormat index_format);+vk::IndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_format);vk::StencilOp StencilOp(Maxwell::StencilOp stencil_op);