diff options
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp index dae24b58..29bd647a 100644 --- a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp @@ -161,12 +161,28 @@ RefCntAutoPtr<PipelineResourceSignatureGLImpl> PipelineStateGLImpl::CreateDefaul ResSignDesc.Name = SignName.c_str(); ResSignDesc.Resources = Resources.data(); ResSignDesc.NumResources = static_cast<Uint32>(Resources.size()); - ResSignDesc.ImmutableSamplers = LayoutDesc.ImmutableSamplers; - ResSignDesc.NumImmutableSamplers = LayoutDesc.NumImmutableSamplers; ResSignDesc.BindingIndex = 0; ResSignDesc.SRBAllocationGranularity = CreateInfo.PSODesc.SRBAllocationGranularity; ResSignDesc.UseCombinedTextureSamplers = true; + std::vector<ImmutableSamplerDesc> ImmutableSamplers; + if (m_IsProgramPipelineSupported) + { + ResSignDesc.ImmutableSamplers = LayoutDesc.ImmutableSamplers; + } + else + { + // Apply each immutable sampler to all shader stages + ImmutableSamplers.resize(LayoutDesc.NumImmutableSamplers); + for (Uint32 i = 0; i < LayoutDesc.NumImmutableSamplers; ++i) + { + ImmutableSamplers[i] = LayoutDesc.ImmutableSamplers[i]; + ImmutableSamplers[i].ShaderStages = ActiveStages; + } + ResSignDesc.ImmutableSamplers = ImmutableSamplers.data(); + } + ResSignDesc.NumImmutableSamplers = LayoutDesc.NumImmutableSamplers; + // Always initialize default resource signature as internal device object. // This is necessary to avoud cyclic references from TexRegionRenderer. // This may never be a problem as the PSO keeps the reference to the device if necessary. |
