diff options
| author | Triang3l <triang3l@yandex.ru> | 2024-05-05 15:15:48 +0300 |
|---|---|---|
| committer | Triang3l <triang3l@yandex.ru> | 2024-05-05 15:20:23 +0300 |
| commit | a90f83d44c47abfae91e2598a07a0eee0355fa68 (patch) | |
| tree | 985d7781957e3279cabea393e7ff03eb00fe5ca4 | |
| parent | e9f7a8bd48198541a3bd71fe6267df3dbe83c5c5 (diff) | |
[Vulkan] Non-seamless cube map filtering
| -rw-r--r-- | src/xenia/gpu/gpu_flags.cc | 7 | ||||
| -rw-r--r-- | src/xenia/gpu/gpu_flags.h | 2 | ||||
| -rw-r--r-- | src/xenia/gpu/vulkan/vulkan_texture_cache.cc | 9 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/xenia/gpu/gpu_flags.cc b/src/xenia/gpu/gpu_flags.cc index 1510eeec0..1b9bd065d 100644 --- a/src/xenia/gpu/gpu_flags.cc +++ b/src/xenia/gpu/gpu_flags.cc @@ -28,6 +28,13 @@ DEFINE_bool( "the real reason why they're invalid is found.", "GPU"); +DEFINE_bool( + non_seamless_cube_map, true, + "Disable filtering between cube map faces near edges where possible " + "(Vulkan with VK_EXT_non_seamless_cube_map) to reproduce the Direct3D 9 " + "behavior.", + "GPU"); + // Extremely bright screen borders in 4D5307E6. // Reading between texels with half-pixel offset in 58410954. DEFINE_bool( diff --git a/src/xenia/gpu/gpu_flags.h b/src/xenia/gpu/gpu_flags.h index 5ae64b76e..ecdc73ca7 100644 --- a/src/xenia/gpu/gpu_flags.h +++ b/src/xenia/gpu/gpu_flags.h @@ -20,6 +20,8 @@ DECLARE_bool(vsync); DECLARE_bool(gpu_allow_invalid_fetch_constants); +DECLARE_bool(non_seamless_cube_map); + DECLARE_bool(half_pixel_offset); DECLARE_int32(query_occlusion_fake_sample_count); diff --git a/src/xenia/gpu/vulkan/vulkan_texture_cache.cc b/src/xenia/gpu/vulkan/vulkan_texture_cache.cc index e056c606c..bff490b9d 100644 --- a/src/xenia/gpu/vulkan/vulkan_texture_cache.cc +++ b/src/xenia/gpu/vulkan/vulkan_texture_cache.cc @@ -17,6 +17,7 @@ #include "xenia/base/logging.h" #include "xenia/base/math.h" #include "xenia/base/profiling.h" +#include "xenia/gpu/gpu_flags.h" #include "xenia/gpu/texture_info.h" #include "xenia/gpu/texture_util.h" #include "xenia/gpu/vulkan/deferred_command_buffer.h" @@ -760,9 +761,11 @@ VkSampler VulkanTextureCache::UseSampler(SamplerParameters parameters, // GetSamplerParameters. VkSamplerCreateInfo sampler_create_info = {}; sampler_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; - // TODO(Triang3l): VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT if - // VK_EXT_non_seamless_cube_map and the nonSeamlessCubeMap feature are - // supported. + if (provider.device_info().nonSeamlessCubeMap && + cvars::non_seamless_cube_map) { + sampler_create_info.flags |= + VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT; + } sampler_create_info.magFilter = parameters.mag_linear ? VK_FILTER_LINEAR : VK_FILTER_NEAREST; sampler_create_info.minFilter = |
