diff --git a/rpcs3/Emu/RSX/VK/VKFormats.cpp b/rpcs3/Emu/RSX/VK/VKFormats.cpp index fb36bb7cfa..d841dc595e 100644 --- a/rpcs3/Emu/RSX/VK/VKFormats.cpp +++ b/rpcs3/Emu/RSX/VK/VKFormats.cpp @@ -65,6 +65,16 @@ VkFilter get_mag_filter(rsx::texture_magnify_filter mag_filter) throw EXCEPTION("Invalid mag filter (0x%x)", mag_filter); } +VkBorderColor get_border_color(u8 color) +{ + if ((color / 0x10) >= 0x8) + return VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; + else + return VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK; + + // TODO: VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK +} + VkSamplerAddressMode vk_wrap_mode(rsx::texture_wrap_mode gcm_wrap) { switch (gcm_wrap) diff --git a/rpcs3/Emu/RSX/VK/VKFormats.h b/rpcs3/Emu/RSX/VK/VKFormats.h index 95f2d32b5c..31760b0863 100644 --- a/rpcs3/Emu/RSX/VK/VKFormats.h +++ b/rpcs3/Emu/RSX/VK/VKFormats.h @@ -15,6 +15,7 @@ namespace vk VkStencilOp get_stencil_op(u32 op); VkLogicOp get_logic_op(u32 op); VkFrontFace get_front_face_ccw(u32 ffv); + VkBorderColor get_border_color(u8 color); std::tuple get_min_filter_and_mip(rsx::texture_minify_filter min_filter); VkFilter get_mag_filter(rsx::texture_magnify_filter mag_filter); diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index a18ffa2909..f4844dc04c 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -655,7 +655,7 @@ void VKGSRender::end() vk::vk_wrap_mode(textures[i].wrap_s()), vk::vk_wrap_mode(textures[i].wrap_t()), vk::vk_wrap_mode(textures[i].wrap_r()), !!(textures[i].format() & CELL_GCM_TEXTURE_UN), textures[i].bias(), vk::max_aniso(textures[i].max_aniso()), textures[i].min_lod(), textures[i].max_lod(), - min_filter, vk::get_mag_filter(textures[i].mag_filter()), mip_mode + min_filter, vk::get_mag_filter(textures[i].mag_filter()), mip_mode, vk::get_border_color(textures[i].border_color()) )); m_program->bind_uniform({ m_sampler_to_clean.back()->value, texture0->value, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL }, "tex" + std::to_string(i), descriptor_sets); } diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index e57be7f091..b5373900f9 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -552,7 +552,7 @@ namespace vk sampler(VkDevice dev, VkSamplerAddressMode clamp_u, VkSamplerAddressMode clamp_v, VkSamplerAddressMode clamp_w, bool unnormalized_coordinates, float mipLodBias, float max_anisotropy, float min_lod, float max_lod, - VkFilter min_filter, VkFilter mag_filter, VkSamplerMipmapMode mipmap_mode) + VkFilter min_filter, VkFilter mag_filter, VkSamplerMipmapMode mipmap_mode, VkBorderColor border_color) : m_device(dev) { VkSamplerCreateInfo info = {}; @@ -571,7 +571,7 @@ namespace vk info.minFilter = min_filter; info.mipmapMode = mipmap_mode; info.compareOp = VK_COMPARE_OP_NEVER; - info.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK; + info.borderColor = border_color; CHECK_RESULT(vkCreateSampler(m_device, &info, nullptr, &value)); }