vulkan: Few fixes for MoltenVK (#670)

* vulkan: Use SPIR-V 1.5 when Vulkan version is 1.2

* vulkan: Fix Format2_10_10_10 mismap
This commit is contained in:
squidbus 2024-08-30 06:40:39 -07:00 committed by GitHub
parent f1fe6b9f96
commit 6080066f75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 10 deletions

View File

@ -287,8 +287,8 @@ vk::BorderColor BorderColor(AmdGpu::BorderColor color) {
std::span<const vk::Format> GetAllFormats() {
static constexpr std::array formats{
vk::Format::eA2B10G10R10SnormPack32,
vk::Format::eA2B10G10R10UnormPack32,
vk::Format::eA2R10G10B10SnormPack32,
vk::Format::eA2R10G10B10UnormPack32,
vk::Format::eB5G6R5UnormPack16,
vk::Format::eB8G8R8A8Srgb,
@ -424,6 +424,10 @@ vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat nu
num_format == AmdGpu::NumberFormat::Unorm) {
return vk::Format::eA2B10G10R10UnormPack32;
}
if (data_format == AmdGpu::DataFormat::Format2_10_10_10 &&
num_format == AmdGpu::NumberFormat::Snorm) {
return vk::Format::eA2B10G10R10SnormPack32;
}
if (data_format == AmdGpu::DataFormat::FormatBc7 && num_format == AmdGpu::NumberFormat::Srgb) {
return vk::Format::eBc7SrgbBlock;
}
@ -472,14 +476,6 @@ vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat nu
num_format == AmdGpu::NumberFormat::Snorm) {
return vk::Format::eR16G16Snorm;
}
if (data_format == AmdGpu::DataFormat::Format2_10_10_10 &&
num_format == AmdGpu::NumberFormat::Unorm) {
return vk::Format::eA2R10G10B10UnormPack32;
}
if (data_format == AmdGpu::DataFormat::Format2_10_10_10 &&
num_format == AmdGpu::NumberFormat::Snorm) {
return vk::Format::eA2R10G10B10SnormPack32;
}
if (data_format == AmdGpu::DataFormat::Format10_11_11 &&
num_format == AmdGpu::NumberFormat::Float) {
return vk::Format::eB10G11R11UfloatPack32;

View File

@ -107,7 +107,7 @@ Shader::Info MakeShaderInfo(const GuestProgram& pgm, const AmdGpu::Liverpool::Re
ShaderCache::ShaderCache(const Instance& instance_, AmdGpu::Liverpool* liverpool_)
: instance{instance_}, liverpool{liverpool_}, inst_pool{8192}, block_pool{512} {
profile = Shader::Profile{
.supported_spirv = 0x00010600U,
.supported_spirv = instance.ApiVersion() >= VK_API_VERSION_1_3 ? 0x00010600U : 0x00010500U,
.subgroup_size = instance.SubgroupSize(),
.support_explicit_workgroup_layout = true,
};