forked from ShuriZma/suyu
distinguish between moltenVK and other drivers.
This commit is contained in:
parent
8b395f188c
commit
47ab25dbf7
|
@ -136,7 +136,10 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
|
||||||
auto usage = ImageUsageFlags(format_info, info.format);
|
auto usage = ImageUsageFlags(format_info, info.format);
|
||||||
if (is_3d) {
|
if (is_3d) {
|
||||||
flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
|
flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
|
||||||
usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
// Force usage to be VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT only on MoltenVK
|
||||||
|
if (device.IsMoltenVK()) {
|
||||||
|
usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(info.num_samples);
|
const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(info.num_samples);
|
||||||
return VkImageCreateInfo{
|
return VkImageCreateInfo{
|
||||||
|
@ -164,8 +167,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
|
||||||
|
|
||||||
[[nodiscard]] vk::Image MakeImage(const Device& device, const MemoryAllocator& allocator,
|
[[nodiscard]] vk::Image MakeImage(const Device& device, const MemoryAllocator& allocator,
|
||||||
const ImageInfo& info, std::span<const VkFormat> view_formats) {
|
const ImageInfo& info, std::span<const VkFormat> view_formats) {
|
||||||
const bool is_buffer = (info.type == ImageType::Buffer);
|
if (info.type == ImageType::Buffer) {
|
||||||
if (is_buffer) {
|
|
||||||
return vk::Image{};
|
return vk::Image{};
|
||||||
}
|
}
|
||||||
VkImageCreateInfo image_ci = MakeImageCreateInfo(device, info);
|
VkImageCreateInfo image_ci = MakeImageCreateInfo(device, info);
|
||||||
|
|
|
@ -702,6 +702,11 @@ public:
|
||||||
return properties.driver.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY;
|
return properties.driver.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Checks if we are runing MolvenVK.
|
||||||
|
bool IsMoltenVK() const noexcept {
|
||||||
|
return properties.driver.driverID == VK_DRIVER_ID_MOLTENVK;
|
||||||
|
}
|
||||||
|
|
||||||
NvidiaArchitecture GetNvidiaArch() const noexcept {
|
NvidiaArchitecture GetNvidiaArch() const noexcept {
|
||||||
return nvidia_arch;
|
return nvidia_arch;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue