older tvos hardware does not support layered rendering

This commit is contained in:
Eric Warmenhoven 2026-02-23 15:49:42 -05:00 committed by OpenSauce
parent 13e0fdeac1
commit fe59958b63
2 changed files with 17 additions and 0 deletions

View File

@ -618,6 +618,20 @@ bool Instance::CreateDevice() {
#undef PROP_GET
#undef FEAT_SET
// Check layered rendering support on MoltenVK
// MoltenVK maps Metal's layeredRendering capability to shaderOutputLayer
if (is_moltenvk) {
vk::PhysicalDeviceVulkan12Features vulkan12_features;
vk::PhysicalDeviceFeatures2 features2;
features2.pNext = &vulkan12_features;
physical_device.getFeatures2(&features2);
if (!vulkan12_features.shaderOutputLayer) {
LOG_INFO(Render_Vulkan,
"Disabling layered rendering (shaderOutputLayer not supported by device)");
layered_rendering_supported = false;
}
}
#ifdef HAVE_LIBRETRO
// LibRetro builds: device already created by frontend, just return after feature detection
return true;

View File

@ -169,6 +169,9 @@ void Handle::Create(const Instance* instance, u32 width, u32 height, u32 levels,
std::string_view debug_name) {
const bool is_cube_map =
type == TextureType::CubeMap && instance->IsLayeredRenderingSupported();
if (!is_cube_map) {
flags &= ~vk::ImageCreateFlagBits::eCubeCompatible;
}
this->instance = instance;
this->width = width;