Skip to content
Permalink
Browse files

[Shaders] D3D: Properly copy ElementType when duplicating resource bi…

…nding per stage (fixes #515)
  • Loading branch information
xen2 committed Sep 24, 2019
1 parent 8787a19 commit 4e7826874d4b8d4e12222b21f9d2bcf57768f675
Showing with 3 additions and 0 deletions.
  1. +3 −0 sources/engine/Xenko.Shaders.Compiler/Direct3D/ShaderCompiler.cs
@@ -117,13 +117,15 @@ private void UpdateReflection(ShaderBytecode shaderBytecode, EffectReflection ef
string linkKeyName = null;
string resourceGroup = null;
string logicalGroup = null;
var elementType = default(EffectTypeDescription);
foreach (var linkResource in effectReflection.ResourceBindings)
{
if (linkResource.RawName == boundResourceDesc.Name && linkResource.Stage == ShaderStage.None)
{
linkKeyName = linkResource.KeyInfo.KeyName;
resourceGroup = linkResource.ResourceGroup;
logicalGroup = linkResource.LogicalGroup;
elementType = linkResource.ElementType;
break;
}

@@ -140,6 +142,7 @@ private void UpdateReflection(ShaderBytecode shaderBytecode, EffectReflection ef
binding.Stage = shaderBytecode.Stage;
binding.ResourceGroup = resourceGroup;
binding.LogicalGroup = logicalGroup;
binding.ElementType = elementType;

effectReflection.ResourceBindings.Add(binding);
}

0 comments on commit 4e78268

Please sign in to comment.
You can’t perform that action at this time.