diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-10-07 20:05:34 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-10-07 20:05:34 +0000 |
| commit | 01a6742a3ccd45c8f8cd74f84c9b093c398450fc (patch) | |
| tree | 2014633aca9baae701912aca1d01549dc5cd5e99 /Graphics/GraphicsEngineOpenGL | |
| parent | Removed D3D11 debug names for Depth-stencil, Rasterizer, Blend states and sam... (diff) | |
| download | DiligentCore-01a6742a3ccd45c8f8cd74f84c9b093c398450fc.tar.gz DiligentCore-01a6742a3ccd45c8f8cd74f84c9b093c398450fc.zip | |
Added TextureFormatInfoExt::SampleCounts. Reworked texture format support queries in D3D11 and D3D12
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index 9524554e..f10a4277 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -646,16 +646,21 @@ void RenderDeviceGLImpl::TestTextureFormat( TEXTURE_FORMAT TexFormat ) } } - TexFormatInfo.SupportsMS = false; + TexFormatInfo.SampleCounts = 0x01; if( TexFormatInfo.ComponentType != COMPONENT_TYPE_COMPRESSED && m_DeviceCaps.TexCaps.bTexture2DMSSupported ) { #if GL_ARB_texture_storage_multisample - GLObjectWrappers::GLTextureObj TestGLTex( true ); - TexFormatInfo.SupportsMS = CreateTestGLTexture( ContextState, GL_TEXTURE_2D_MULTISAMPLE, TestGLTex, [&]() + for (GLsizei SampleCount = 2; SampleCount <= 8; SampleCount *= 2) { - glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GLFmt, TestTextureDim, TestTextureDim, GL_TRUE); - } ); + GLObjectWrappers::GLTextureObj TestGLTex( true ); + auto SampleCountSupported = CreateTestGLTexture( ContextState, GL_TEXTURE_2D_MULTISAMPLE, TestGLTex, [&]() + { + glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, SampleCount, GLFmt, TestTextureDim, TestTextureDim, GL_TRUE); + } ); + if (SampleCountSupported) + TexFormatInfo.SampleCounts |= SampleCount; + } #endif } |
