From c238d8af550c457ac61a4ebef6888b3895802dbb Mon Sep 17 00:00:00 2001 From: Triang3l Date: Thu, 30 Mar 2023 22:28:56 +0300 Subject: [PATCH] [Vulkan] Fix FragStencilRef store type --- .../gpu/vulkan/vulkan_render_target_cache.cc | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc b/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc index 8113827e5..ecd4b7fd1 100644 --- a/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc +++ b/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc @@ -3174,7 +3174,9 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader( source_stencil[0] != spv::NoResult) { // For the depth -> depth case, write the stencil directly to the output. assert_true(mode.output == TransferOutput::kDepth); - builder.createStore(source_stencil[0], output_fragment_stencil_ref); + builder.createStore(builder.createUnaryOp(spv::OpBitcast, type_int, + source_stencil[0]), + output_fragment_stencil_ref); } if (dest_is_64bpp) { @@ -3518,13 +3520,15 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader( if (output_fragment_stencil_ref != spv::NoResult) { builder.createStore( builder.createUnaryOp( - spv::OpConvertFToU, type_uint, - builder.createBinOp( - spv::OpFAdd, type_float, - builder.createBinOp(spv::OpFMul, type_float, - source_color[0][0], - unorm_scale), - unorm_round_offset)), + spv::OpBitcast, type_int, + builder.createUnaryOp( + spv::OpConvertFToU, type_uint, + builder.createBinOp( + spv::OpFAdd, type_float, + builder.createBinOp(spv::OpFMul, type_float, + source_color[0][0], + unorm_scale), + unorm_round_offset))), output_fragment_stencil_ref); } }