diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-02-21 03:17:56 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-02-21 03:17:56 +0000 |
| commit | 40bcea32df033a6ea453b6225b64697ac25c315b (patch) | |
| tree | d783d8ae57ebf37b4ec5b01873d8a221f8f85235 /Graphics | |
| parent | Minor update to HLSL2GLSLConverter (diff) | |
| download | DiligentCore-40bcea32df033a6ea453b6225b64697ac25c315b.tar.gz DiligentCore-40bcea32df033a6ea453b6225b64697ac25c315b.zip | |
Use in/out layout qualifiers when separate shader objects extension is available
Diffstat (limited to 'Graphics')
| -rw-r--r-- | Graphics/GLSLTools/src/GLSLSourceBuilder.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp index 3ac24f83..e8a2ba94 100644 --- a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp +++ b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp @@ -248,15 +248,20 @@ String BuildGLSLSourceString(const ShaderCreationAttribs& CreationAttribs, // Convert HLSL to GLSL const auto &Converter = HLSL2GLSLConverterImpl::GetInstance(); HLSL2GLSLConverterImpl::ConversionAttribs Attribs; - Attribs.pSourceStreamFactory = CreationAttribs.pShaderSourceStreamFactory; - Attribs.ppConversionStream = CreationAttribs.ppConversionStream; - Attribs.HLSLSource = ShaderSource; - Attribs.NumSymbols = SourceLen; - Attribs.EntryPoint = CreationAttribs.EntryPoint; - Attribs.ShaderType = CreationAttribs.Desc.ShaderType; - Attribs.IncludeDefinitions = true; - Attribs.InputFileName = CreationAttribs.FilePath; - Attribs.SamplerSuffix = CreationAttribs.CombinedSamplerSuffix; + Attribs.pSourceStreamFactory = CreationAttribs.pShaderSourceStreamFactory; + Attribs.ppConversionStream = CreationAttribs.ppConversionStream; + Attribs.HLSLSource = ShaderSource; + Attribs.NumSymbols = SourceLen; + Attribs.EntryPoint = CreationAttribs.EntryPoint; + Attribs.ShaderType = CreationAttribs.Desc.ShaderType; + Attribs.IncludeDefinitions = true; + Attribs.InputFileName = CreationAttribs.FilePath; + Attribs.SamplerSuffix = CreationAttribs.CombinedSamplerSuffix; + // Separate shader objects extension also allows input/output layout qualifiers for + // all shader stages. + // https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_separate_shader_objects.txt + // (search for "Input Layout Qualifiers" and "Output Layout Qualifiers"). + Attribs.UseInOutLocationQualifiers = deviceCaps.bSeparableProgramSupported; auto ConvertedSource = Converter.Convert(Attribs); GLSLSource.append(ConvertedSource); |
