diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-07-23 02:21:27 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-07-23 02:21:27 +0000 |
| commit | 7548f10f1e0ee707575d56ff84059f19d7132fe5 (patch) | |
| tree | 3f6a3f3295e5e2e8f2d4c11cb12234fd36d7cb34 /Components/src/ShadowMapManager.cpp | |
| parent | Shadow map manager: improved cascade distribution to support world-scale size... (diff) | |
| download | DiligentFX-7548f10f1e0ee707575d56ff84059f19d7132fe5.tar.gz DiligentFX-7548f10f1e0ee707575d56ff84059f19d7132fe5.zip | |
ShadowMap manager: fixed GL warning
Diffstat (limited to 'Components/src/ShadowMapManager.cpp')
| -rw-r--r-- | Components/src/ShadowMapManager.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Components/src/ShadowMapManager.cpp b/Components/src/ShadowMapManager.cpp index e55b14c..2ce79c9 100644 --- a/Components/src/ShadowMapManager.cpp +++ b/Components/src/ShadowMapManager.cpp @@ -26,6 +26,7 @@ #include "../../../Utilities/include/DiligentFXShaderSourceStreamFactory.h" #include "GraphicsUtilities.h" #include "MapHelper.h" +#include "CommonlyUsedStates.h" namespace Diligent { @@ -459,9 +460,21 @@ void ShadowMapManager::InitializeConversionTechniques(TEXTURE_FORMAT FilterableS { {SHADER_TYPE_PIXEL, "g_tex2DShadowMap", SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE} }; - - PSODesc.ResourceLayout.Variables = Variables; - PSODesc.ResourceLayout.NumVariables = _countof(Variables); + + StaticSamplerDesc StaticSamplers[] = + { + {SHADER_TYPE_PIXEL, "g_tex2DShadowMap", Sam_LinearClamp} + }; + + if (m_pDevice->GetDeviceCaps().IsGLDevice()) + { + // Even though textures are never sampled in the shader, OpenGL requires proper + // sampler to be set even when texelFetch is used. + PSODesc.ResourceLayout.StaticSamplers = StaticSamplers; + PSODesc.ResourceLayout.NumStaticSamplers = _countof(StaticSamplers); + } + PSODesc.ResourceLayout.Variables = Variables; + PSODesc.ResourceLayout.NumVariables = _countof(Variables); auto& GraphicsPipeline = PSODesc.GraphicsPipeline; GraphicsPipeline.RasterizerDesc.FillMode = FILL_MODE_SOLID; GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE; |
