Amer Koleci пре 8 година
родитељ
комит
989c2c2aac

+ 0 - 5
src/ShaderGen/GlslBackendBase.cs

@@ -271,10 +271,5 @@ namespace ShaderGen
             string normalizedIdentifier,
             int index);
         protected abstract void EmitGlPositionCorrection(StringBuilder sb);
-
-        protected override string FormatSwizzleCore(string type, string method, InvocationParameterInfo[] parameterInfos)
-        {
-            return $"{parameterInfos[0].Identifier}.{method}";
-        }
     }
 }

+ 0 - 5
src/ShaderGen/HlslBackend.cs

@@ -260,10 +260,5 @@ namespace ShaderGen
         {
             return identifier;
         }
-
-        protected override string FormatSwizzleCore(string type, string method, InvocationParameterInfo[] parameterInfos)
-        {
-            return $"{parameterInfos[0].Identifier}.{method}";
-        }
     }
 }

+ 0 - 10
src/ShaderGen/LanguageBackend.cs

@@ -174,15 +174,6 @@ namespace ShaderGen
             return FormatInvocationCore(type, method, parameterInfos);
         }
 
-        internal string FormatSwizzle(string type, string method, InvocationParameterInfo[] parameterInfos)
-        {
-            Debug.Assert(type != null);
-            Debug.Assert(method != null);
-            Debug.Assert(parameterInfos != null);
-
-            return FormatSwizzleCore(type, method, parameterInfos);
-        }
-
         protected void ValidateRequiredSemantics(string setName, ShaderFunction function, ShaderFunctionType type)
         {
             if (type == ShaderFunctionType.VertexEntryPoint)
@@ -253,7 +244,6 @@ namespace ShaderGen
         protected abstract string CSharpToIdentifierNameCore(string typeName, string identifier);
         protected abstract string GenerateFullTextCore(string setName, ShaderFunction function);
         protected abstract string FormatInvocationCore(string type, string method, InvocationParameterInfo[] parameterInfos);
-        protected abstract string FormatSwizzleCore(string type, string method, InvocationParameterInfo[] parameterInfos);
 
         internal string CorrectLiteral(string literal)
         {

+ 1 - 1
src/ShaderGen/ShaderMethodVisitor.cs

@@ -130,7 +130,7 @@ namespace ShaderGen
                 // Manage swizzle
                 if (symbolInfo.Symbol.Name.Equals(nameof(ShaderSwizzle), StringComparison.OrdinalIgnoreCase))
                 {
-                    return _backend.FormatSwizzle(type, method, parameterInfos);
+                    return $"{parameterInfos[0].Identifier}.{method.ToLowerInvariant()}";
                 }
 
                 return _backend.FormatInvocation(type, method, parameterInfos);