mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[dxvk] Re-add render target format validation
This was lost during the state cache and render target state rework.
This commit is contained in:
parent
021aff1fc0
commit
c6168179bd
@ -997,6 +997,31 @@ namespace dxvk {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validate render target format support
|
||||
VkFormat depthFormat = state.rt.getDepthStencilFormat();
|
||||
|
||||
if (depthFormat) {
|
||||
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(depthFormat);
|
||||
|
||||
if (!(formatInfo.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) {
|
||||
Logger::err(str::format(depthFormat, " not supported as depth-stencil attachment"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
||||
VkFormat colorFormat = state.rt.getColorFormat(i);
|
||||
|
||||
if (colorFormat) {
|
||||
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(colorFormat);
|
||||
|
||||
if (!(formatInfo.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) {
|
||||
Logger::err(str::format(depthFormat, " not supported as color attachment"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user