mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Don't spam log messages when pipeline state validation fails
This commit is contained in:
parent
4d8b75c8fb
commit
54f9eaf13c
@ -1018,10 +1018,8 @@ namespace dxvk {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Validate shaders
|
// Validate shaders
|
||||||
if (!m_shaders.validate()) {
|
if (!m_shaders.validate())
|
||||||
Logger::err("Invalid pipeline: Shader types do not match stage");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
// Validate vertex input layout
|
// Validate vertex input layout
|
||||||
uint32_t ilLocationMask = 0;
|
uint32_t ilLocationMask = 0;
|
||||||
@ -1033,45 +1031,33 @@ namespace dxvk {
|
|||||||
for (uint32_t i = 0; i < state.il.attributeCount(); i++) {
|
for (uint32_t i = 0; i < state.il.attributeCount(); i++) {
|
||||||
const DxvkIlAttribute& attribute = state.ilAttributes[i];
|
const DxvkIlAttribute& attribute = state.ilAttributes[i];
|
||||||
|
|
||||||
if (ilLocationMask & (1u << attribute.location())) {
|
if (ilLocationMask & (1u << attribute.location()))
|
||||||
Logger::err(str::format("Invalid pipeline: Vertex location ", attribute.location(), " defined twice"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if (!(ilBindingMask & (1u << attribute.binding()))) {
|
if (!(ilBindingMask & (1u << attribute.binding())))
|
||||||
Logger::err(str::format("Invalid pipeline: Vertex binding ", attribute.binding(), " not defined"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(attribute.format());
|
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(attribute.format());
|
||||||
|
|
||||||
if (!(formatInfo.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT)) {
|
if (!(formatInfo.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT))
|
||||||
Logger::err(str::format("Invalid pipeline: Format ", attribute.format(), " not supported for vertex buffers"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
ilLocationMask |= 1u << attribute.location();
|
ilLocationMask |= 1u << attribute.location();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate rasterization state
|
// Validate rasterization state
|
||||||
if (state.rs.conservativeMode() != VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT) {
|
if (state.rs.conservativeMode() != VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT) {
|
||||||
if (!m_device->extensions().extConservativeRasterization) {
|
if (!m_device->extensions().extConservativeRasterization)
|
||||||
Logger::err("Conservative rasterization not supported by device");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if (state.rs.conservativeMode() == VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT
|
if (state.rs.conservativeMode() == VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT
|
||||||
&& !m_device->properties().extConservativeRasterization.primitiveUnderestimation) {
|
&& !m_device->properties().extConservativeRasterization.primitiveUnderestimation)
|
||||||
Logger::err("Primitive underestimation not supported by device");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate depth-stencil state
|
// Validate depth-stencil state
|
||||||
if (state.ds.enableDepthBoundsTest() && !m_device->features().core.features.depthBounds) {
|
if (state.ds.enableDepthBoundsTest() && !m_device->features().core.features.depthBounds)
|
||||||
Logger::err("Depth bounds not supported by device");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
// Validate render target format support
|
// Validate render target format support
|
||||||
VkFormat depthFormat = state.rt.getDepthStencilFormat();
|
VkFormat depthFormat = state.rt.getDepthStencilFormat();
|
||||||
@ -1079,10 +1065,8 @@ namespace dxvk {
|
|||||||
if (depthFormat) {
|
if (depthFormat) {
|
||||||
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(depthFormat);
|
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(depthFormat);
|
||||||
|
|
||||||
if (!(formatInfo.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) {
|
if (!(formatInfo.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
|
||||||
Logger::err(str::format(depthFormat, " not supported as depth-stencil attachment"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
||||||
@ -1091,10 +1075,8 @@ namespace dxvk {
|
|||||||
if (colorFormat) {
|
if (colorFormat) {
|
||||||
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(colorFormat);
|
VkFormatProperties formatInfo = m_device->adapter()->formatProperties(colorFormat);
|
||||||
|
|
||||||
if (!(formatInfo.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) {
|
if (!(formatInfo.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT))
|
||||||
Logger::err(str::format(depthFormat, " not supported as color attachment"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user