diff --git a/Source/Core/ShaderConductor.cpp b/Source/Core/ShaderConductor.cpp index 602dfad..a08894c 100644 --- a/Source/Core/ShaderConductor.cpp +++ b/Source/Core/ShaderConductor.cpp @@ -749,18 +749,18 @@ namespace if ((source.stage == ShaderStage::VertexShader) && (varClass == spv::StorageClass::StorageClassOutput)) { auto name = compiler->get_name(var); - if (name.find("out_var") == 0) + if ((name.find("out_var_") == 0) || (name.find("out.var.") == 0)) { - name.replace(0, 7, "varying"); + name.replace(0, 8, "varying_"); compiler->set_name(var, name); } } else if ((source.stage == ShaderStage::PixelShader) && (varClass == spv::StorageClass::StorageClassInput)) { auto name = compiler->get_name(var); - if (name.find("in_var") == 0) + if ((name.find("in_var_") == 0) || (name.find("in.var.") == 0)) { - name.replace(0, 6, "varying"); + name.replace(0, 7, "varying_"); compiler->set_name(var, name); } } diff --git a/Source/Tests/Data/Expected/IncludeExist.glsl b/Source/Tests/Data/Expected/IncludeExist.glsl index 0faaf86..ab109ce 100644 --- a/Source/Tests/Data/Expected/IncludeExist.glsl +++ b/Source/Tests/Data/Expected/IncludeExist.glsl @@ -4,10 +4,10 @@ uniform sampler2D SPIRV_Cross_CombinedcolorTexpointSampler; uniform sampler2D SPIRV_Cross_CombinedcolorTexlinearSampler; -varying vec2 in_var_TEXCOORD0; +varying vec2 varying_TEXCOORD0; void main() { - gl_FragData[0] = texture2D(SPIRV_Cross_CombinedcolorTexpointSampler, in_var_TEXCOORD0) + texture2D(SPIRV_Cross_CombinedcolorTexlinearSampler, in_var_TEXCOORD0); + gl_FragData[0] = texture2D(SPIRV_Cross_CombinedcolorTexpointSampler, varying_TEXCOORD0) + texture2D(SPIRV_Cross_CombinedcolorTexlinearSampler, varying_TEXCOORD0); } diff --git a/Source/Tests/Data/Expected/PassThrough_PS.300.essl b/Source/Tests/Data/Expected/PassThrough_PS.300.essl index 682993f..01fbd4a 100644 --- a/Source/Tests/Data/Expected/PassThrough_PS.300.essl +++ b/Source/Tests/Data/Expected/PassThrough_PS.300.essl @@ -2,11 +2,11 @@ precision mediump float; precision highp int; -in highp vec4 in_var_COLOR; +in highp vec4 varying_COLOR; layout(location = 0) out highp vec4 out_var_SV_Target; void main() { - out_var_SV_Target = in_var_COLOR; + out_var_SV_Target = varying_COLOR; } diff --git a/Source/Tests/Data/Expected/PassThrough_PS.300.glsl b/Source/Tests/Data/Expected/PassThrough_PS.300.glsl index 0eb9308..c382206 100644 --- a/Source/Tests/Data/Expected/PassThrough_PS.300.glsl +++ b/Source/Tests/Data/Expected/PassThrough_PS.300.glsl @@ -1,11 +1,11 @@ #version 300 #extension GL_ARB_separate_shader_objects : require -layout(location = 0) in vec4 in_var_COLOR; +layout(location = 0) in vec4 varying_COLOR; out vec4 out_var_SV_Target; void main() { - out_var_SV_Target = in_var_COLOR; + out_var_SV_Target = varying_COLOR; } diff --git a/Source/Tests/Data/Expected/PassThrough_VS.300.essl b/Source/Tests/Data/Expected/PassThrough_VS.300.essl index b2c7390..c508ac1 100644 --- a/Source/Tests/Data/Expected/PassThrough_VS.300.essl +++ b/Source/Tests/Data/Expected/PassThrough_VS.300.essl @@ -2,11 +2,11 @@ layout(location = 0) in vec4 in_var_POSITION; layout(location = 1) in vec2 in_var_TEXCOORD0; -out vec2 out_var_TEXCOORD0; +out vec2 varying_TEXCOORD0; void main() { - out_var_TEXCOORD0 = in_var_TEXCOORD0; + varying_TEXCOORD0 = in_var_TEXCOORD0; gl_Position = in_var_POSITION; } diff --git a/Source/Tests/Data/Expected/PassThrough_VS.300.glsl b/Source/Tests/Data/Expected/PassThrough_VS.300.glsl index 880edc3..c7f3651 100644 --- a/Source/Tests/Data/Expected/PassThrough_VS.300.glsl +++ b/Source/Tests/Data/Expected/PassThrough_VS.300.glsl @@ -8,11 +8,11 @@ out gl_PerVertex in vec4 in_var_POSITION; in vec2 in_var_TEXCOORD0; -layout(location = 0) out vec2 out_var_TEXCOORD0; +layout(location = 0) out vec2 varying_TEXCOORD0; void main() { - out_var_TEXCOORD0 = in_var_TEXCOORD0; + varying_TEXCOORD0 = in_var_TEXCOORD0; gl_Position = in_var_POSITION; } diff --git a/Source/Tests/Data/Expected/ToneMapping_PS.300.essl b/Source/Tests/Data/Expected/ToneMapping_PS.300.essl index 7a683c4..946904a 100644 --- a/Source/Tests/Data/Expected/ToneMapping_PS.300.essl +++ b/Source/Tests/Data/Expected/ToneMapping_PS.300.essl @@ -11,15 +11,15 @@ uniform highp sampler2D SPIRV_Cross_CombinedcolorTexpointSampler; uniform highp sampler2D SPIRV_Cross_CombinedbloomTexlinearSampler; uniform highp sampler2D SPIRV_Cross_CombinedlumTexpointSampler; -in highp vec2 in_var_TEXCOORD0; +in highp vec2 varying_TEXCOORD0; layout(location = 0) out highp vec4 out_var_SV_Target; void main() { - highp vec4 _45 = texture(SPIRV_Cross_CombinedcolorTexpointSampler, in_var_TEXCOORD0); + highp vec4 _45 = texture(SPIRV_Cross_CombinedcolorTexpointSampler, varying_TEXCOORD0); highp vec3 _62 = (_45.xyz * (0.7200000286102294921875 / ((texture(SPIRV_Cross_CombinedlumTexpointSampler, vec2(0.5)).x * cbPS.lumStrength) + 0.001000000047497451305389404296875))).xyz; highp vec3 _66 = (_62 * (vec3(1.0) + (_62 * vec3(0.666666686534881591796875)))).xyz; - highp vec3 _71 = (_66 / (vec3(1.0) + _66)).xyz + (texture(SPIRV_Cross_CombinedbloomTexlinearSampler, in_var_TEXCOORD0).xyz * 0.60000002384185791015625); + highp vec3 _71 = (_66 / (vec3(1.0) + _66)).xyz + (texture(SPIRV_Cross_CombinedbloomTexlinearSampler, varying_TEXCOORD0).xyz * 0.60000002384185791015625); highp vec4 _73 = vec4(_71.x, _71.y, _71.z, _45.w); _73.w = 1.0; out_var_SV_Target = _73; diff --git a/Source/Tests/Data/Expected/ToneMapping_PS.300.glsl b/Source/Tests/Data/Expected/ToneMapping_PS.300.glsl index f0a4b0f..bc44ac5 100644 --- a/Source/Tests/Data/Expected/ToneMapping_PS.300.glsl +++ b/Source/Tests/Data/Expected/ToneMapping_PS.300.glsl @@ -10,15 +10,15 @@ uniform sampler2D SPIRV_Cross_CombinedcolorTexpointSampler; uniform sampler2D SPIRV_Cross_CombinedbloomTexlinearSampler; uniform sampler2D SPIRV_Cross_CombinedlumTexpointSampler; -layout(location = 0) in vec2 in_var_TEXCOORD0; +layout(location = 0) in vec2 varying_TEXCOORD0; out vec4 out_var_SV_Target; void main() { - vec4 _45 = texture(SPIRV_Cross_CombinedcolorTexpointSampler, in_var_TEXCOORD0); + vec4 _45 = texture(SPIRV_Cross_CombinedcolorTexpointSampler, varying_TEXCOORD0); vec3 _62 = (_45.xyz * (0.7200000286102294921875 / ((texture(SPIRV_Cross_CombinedlumTexpointSampler, vec2(0.5)).x * cbPS.lumStrength) + 0.001000000047497451305389404296875))).xyz; vec3 _66 = (_62 * (vec3(1.0) + (_62 * vec3(0.666666686534881591796875)))).xyz; - vec3 _71 = (_66 / (vec3(1.0) + _66)).xyz + (texture(SPIRV_Cross_CombinedbloomTexlinearSampler, in_var_TEXCOORD0).xyz * 0.60000002384185791015625); + vec3 _71 = (_66 / (vec3(1.0) + _66)).xyz + (texture(SPIRV_Cross_CombinedbloomTexlinearSampler, varying_TEXCOORD0).xyz * 0.60000002384185791015625); vec4 _73 = vec4(_71.x, _71.y, _71.z, _45.w); _73.w = 1.0; out_var_SV_Target = _73;