Enable device features, only display sample rate shading option if supported by device

This commit is contained in:
saschawillems 2017-11-04 10:29:45 +01:00
parent a1530114ef
commit 2b04594fe3
2 changed files with 33 additions and 6 deletions

View file

@ -215,6 +215,10 @@ public:
// Enable physical device features required for this example
virtual void getEnabledFeatures()
{
// Enable sample rate shading filtering if supported
if (deviceFeatures.sampleRateShading) {
enabledFeatures.sampleRateShading = VK_TRUE;
}
// Enable anisotropic filtering if supported
if (deviceFeatures.samplerAnisotropy) {
enabledFeatures.samplerAnisotropy = VK_TRUE;
@ -1179,8 +1183,10 @@ public:
if (overlay->checkBox("MSAA", &useMSAA)) {
buildCommandBuffers();
}
if (overlay->checkBox("Sample rate shading", &useSampleShading)) {
buildDeferredCommandBuffer();
if (vulkanDevice->features.sampleRateShading) {
if (overlay->checkBox("Sample rate shading", &useSampleShading)) {
buildDeferredCommandBuffer();
}
}
}
}