From 01a6742a3ccd45c8f8cd74f84c9b093c398450fc Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 7 Oct 2018 13:05:34 -0700 Subject: Added TextureFormatInfoExt::SampleCounts. Reworked texture format support queries in D3D11 and D3D12 --- Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') 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 } -- cgit v1.2.3