Skip to content
Permalink
Browse files

[Shaders] Added ElementType info to reflection for buffers/textures

  • Loading branch information
xen2 committed Sep 6, 2019
1 parent 76ca671 commit ae24533c7e79d536e73ccf3d0d28e610c1f5d144
Showing with 7,343 additions and 6,444 deletions.
  1. +740 −706 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecode.Direct3D11.Level_9_1.cs
  2. +80 −79 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecode.OpenGL.Level_9_1.cs
  3. +269 −108 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecode.OpenGLES.Level_9_1.cs
  4. +126 −123 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecode.Vulkan.Level_9_1.cs
  5. +729 −727 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecodeSRgb.Direct3D11.Level_9_1.cs
  6. +84 −82 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecodeSRgb.OpenGL.Level_9_1.cs
  7. +269 −108 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecodeSRgb.OpenGLES.Level_9_1.cs
  8. +139 −136 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteBatch.bytecodeSRgb.Vulkan.Level_9_1.cs
  9. +531 −497 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteEffect.bytecode.Direct3D11.Level_9_1.cs
  10. +68 −66 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteEffect.bytecode.OpenGL.Level_9_1.cs
  11. +156 −91 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteEffect.bytecode.OpenGLES.Level_9_1.cs
  12. +117 −114 sources/engine/Xenko.Graphics/Shaders.Bytecodes/SpriteEffect.bytecode.Vulkan.Level_9_1.cs
  13. +572 −539 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecode.Direct3D11.Level_9_1.cs
  14. +57 −56 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecode.OpenGL.Level_9_1.cs
  15. +138 −73 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecode.OpenGLES.Level_9_1.cs
  16. +107 −105 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecode.Vulkan.Level_9_1.cs
  17. +617 −584 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecodeSRgb.Direct3D11.Level_9_1.cs
  18. +61 −60 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecodeSRgb.OpenGL.Level_9_1.cs
  19. +202 −73 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecodeSRgb.OpenGLES.Level_9_1.cs
  20. +119 −116 sources/engine/Xenko.Graphics/Shaders.Bytecodes/UIEffect.bytecodeSRgb.Vulkan.Level_9_1.cs
  21. +672 −606 ...3.Bytecodes/SignedDistanceFieldFontShader.signedDistanceFieldFontBytecode.Direct3D11.Level_9_3.cs
  22. +68 −67 ...rs093.Bytecodes/SignedDistanceFieldFontShader.signedDistanceFieldFontBytecode.OpenGL.Level_9_3.cs
  23. +158 −125 ...093.Bytecodes/SignedDistanceFieldFontShader.signedDistanceFieldFontBytecode.OpenGLES.Level_9_3.cs
  24. +136 −133 ...rs093.Bytecodes/SignedDistanceFieldFontShader.signedDistanceFieldFontBytecode.Vulkan.Level_9_3.cs
  25. +678 −676 ...SpriteSignedDistanceFieldFontShader.spriteSignedDistanceFieldFontBytecode.Direct3D11.Level_9_3.cs
  26. +88 −86 ...des/SpriteSignedDistanceFieldFontShader.spriteSignedDistanceFieldFontBytecode.OpenGL.Level_9_3.cs
  27. +179 −145 ...s/SpriteSignedDistanceFieldFontShader.spriteSignedDistanceFieldFontBytecode.OpenGLES.Level_9_3.cs
  28. +162 −159 ...des/SpriteSignedDistanceFieldFontShader.spriteSignedDistanceFieldFontBytecode.Vulkan.Level_9_3.cs
  29. +15 −3 sources/engine/Xenko.Shaders.Parser/ShaderLinker.cs
  30. +1 −1 sources/engine/Xenko.Shaders/EffectBytecode.cs
  31. +5 −0 sources/engine/Xenko.Shaders/EffectResourceBindingDescription.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -321,7 +321,7 @@ private LocalParameterKey GetLinkParameterKey(Node node)

var variableType = variable.Type;

parameterKey.Type = CreateTypeInfo(variableType, attributable.Attributes);
parameterKey.Type = CreateTypeInfo(variableType, attributable.Attributes, out parameterKey.ElementType);
}

return parameterKey;
@@ -330,8 +330,10 @@ private LocalParameterKey GetLinkParameterKey(Node node)
return null;
}

private static EffectTypeDescription CreateTypeInfo(TypeBase variableType, List<AttributeBase> attributes)
private static EffectTypeDescription CreateTypeInfo(TypeBase variableType, List<AttributeBase> attributes, out EffectTypeDescription elementType)
{
elementType = default;

var parameterTypeInfo = new EffectTypeDescription();

if (variableType.TypeInference.TargetType != null)
@@ -413,7 +415,7 @@ private static EffectTypeDescription CreateTypeInfo(TypeBase variableType, List<
var memberInfo = new EffectTypeMemberDescription
{
Name = field.Name.Text,
Type = CreateTypeInfo(field.Type, field.Attributes),
Type = CreateTypeInfo(field.Type, field.Attributes, out var _),
};
members.Add(memberInfo);
}
@@ -424,6 +426,11 @@ private static EffectTypeDescription CreateTypeInfo(TypeBase variableType, List<
{
var variableTypeName = variableType.Name.Text.ToLowerInvariant();

if (variableType is ClassType classType && classType.GenericArguments.Count == 1)
{
elementType = CreateTypeInfo(classType.GenericArguments[0], new List<AttributeBase>(), out var _);
}

switch (variableTypeName)
{
case "cbuffer":
@@ -689,6 +696,11 @@ private class LocalParameterKey

public EffectTypeDescription Type;

/// <summary>
/// The element type (for buffers or textures).
/// </summary>
public EffectTypeDescription ElementType;

/*public EffectParameterClass Class;
public EffectParameterType Type;
@@ -24,7 +24,7 @@ public sealed class EffectBytecode
/// <remarks>
/// If EffectBytecode is changed, this number must be changed manually.
/// </remarks>
public const uint MagicHeader = 0xEFFEC005;
public const uint MagicHeader = 0xEFFEC006;

/// <summary>
/// The reflection from the bytecode.
@@ -27,6 +27,11 @@ public struct EffectResourceBindingDescription
/// </summary>
public EffectParameterType Type;

/// <summary>
/// The element type (for buffers or textures).
/// </summary>
public EffectTypeDescription ElementType;

/// <summary>
/// Name of this parameter in the original shader
/// </summary>

0 comments on commit ae24533

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