Skip to content

Commit

Permalink
[Vk] Don't crash if VulkanRenderSystem::validateSampleDescription is …
Browse files Browse the repository at this point in the history
…called before first window creation
  • Loading branch information
eugenegff committed Jun 1, 2022
1 parent dc52a1d commit 1871a53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3244,10 +3244,10 @@ namespace Ogre
SampleDescription VulkanRenderSystem::validateSampleDescription( const SampleDescription &sampleDesc,
PixelFormatGpu format )
{
SampleDescription retVal(
(uint8)getMaxUsableSampleCount( mDevice->mDeviceProperties, sampleDesc.getMaxSamples() ),
sampleDesc.getMsaaPattern() );
return retVal;
uint8 samples = sampleDesc.getMaxSamples();
if( mDevice )
samples = (uint8)getMaxUsableSampleCount( mDevice->mDeviceProperties, samples );
return SampleDescription( samples, sampleDesc.getMsaaPattern() );
}
//-------------------------------------------------------------------------
bool VulkanRenderSystem::isSameLayout( ResourceLayout::Layout a, ResourceLayout::Layout b,
Expand Down

0 comments on commit 1871a53

Please sign in to comment.