|
|
@ -50,8 +50,7 @@ VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter |
|
|
return {}; |
|
|
return {}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wrap_mode, |
|
|
|
|
|
Tegra::Texture::TextureFilter filter) { |
|
|
|
|
|
|
|
|
VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wrap_mode) { |
|
|
switch (wrap_mode) { |
|
|
switch (wrap_mode) { |
|
|
case Tegra::Texture::WrapMode::Wrap: |
|
|
case Tegra::Texture::WrapMode::Wrap: |
|
|
return VK_SAMPLER_ADDRESS_MODE_REPEAT; |
|
|
return VK_SAMPLER_ADDRESS_MODE_REPEAT; |
|
|
@ -62,19 +61,6 @@ VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wra |
|
|
case Tegra::Texture::WrapMode::Border: |
|
|
case Tegra::Texture::WrapMode::Border: |
|
|
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; |
|
|
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; |
|
|
case Tegra::Texture::WrapMode::Clamp: |
|
|
case Tegra::Texture::WrapMode::Clamp: |
|
|
if (device.GetDriverID() == VK_DRIVER_ID_NVIDIA_PROPRIETARY) { |
|
|
|
|
|
// Nvidia's Vulkan driver defaults to GL_CLAMP on invalid enumerations, we can hack this
|
|
|
|
|
|
// by sending an invalid enumeration.
|
|
|
|
|
|
return static_cast<VkSamplerAddressMode>(0xcafe); |
|
|
|
|
|
} |
|
|
|
|
|
// TODO(Rodrigo): Emulate GL_CLAMP properly on other vendors
|
|
|
|
|
|
switch (filter) { |
|
|
|
|
|
case Tegra::Texture::TextureFilter::Nearest: |
|
|
|
|
|
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; |
|
|
|
|
|
case Tegra::Texture::TextureFilter::Linear: |
|
|
|
|
|
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; |
|
|
|
|
|
} |
|
|
|
|
|
ASSERT(false); |
|
|
|
|
|
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; |
|
|
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; |
|
|
case Tegra::Texture::WrapMode::MirrorOnceClampToEdge: |
|
|
case Tegra::Texture::WrapMode::MirrorOnceClampToEdge: |
|
|
return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; |
|
|
return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; |
|
|
|