Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2021-05-07 14:15:55 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2021-05-07 14:15:55 +0300
commitb8115ffbe096bfe8ad979d40bb7480aed06226c6 (patch)
tree96c651dca2185f14851a793b702809e240369a23 /reference/opt
parente47a30e807990c6fe1998c9c4f291d825f043557 (diff)
HLSL: Implement invariant as precise.
Only option we have.
Diffstat (limited to 'reference/opt')
-rw-r--r--reference/opt/shaders-hlsl/vert/invariant.vert40
1 files changed, 40 insertions, 0 deletions
diff --git a/reference/opt/shaders-hlsl/vert/invariant.vert b/reference/opt/shaders-hlsl/vert/invariant.vert
new file mode 100644
index 00000000..54739626
--- /dev/null
+++ b/reference/opt/shaders-hlsl/vert/invariant.vert
@@ -0,0 +1,40 @@
+static float4 gl_Position;
+static float4 vInput0;
+static float4 vInput1;
+static float4 vInput2;
+static float4 vColor;
+
+struct SPIRV_Cross_Input
+{
+ float4 vInput0 : TEXCOORD0;
+ float4 vInput1 : TEXCOORD1;
+ float4 vInput2 : TEXCOORD2;
+};
+
+struct SPIRV_Cross_Output
+{
+ precise float4 vColor : TEXCOORD0;
+ precise float4 gl_Position : SV_Position;
+};
+
+void vert_main()
+{
+ float4 _20 = vInput1 * vInput2;
+ float4 _21 = vInput0 + _20;
+ gl_Position = _21;
+ float4 _27 = vInput0 - vInput1;
+ float4 _29 = _27 * vInput2;
+ vColor = _29;
+}
+
+SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
+{
+ vInput0 = stage_input.vInput0;
+ vInput1 = stage_input.vInput1;
+ vInput2 = stage_input.vInput2;
+ vert_main();
+ SPIRV_Cross_Output stage_output;
+ stage_output.gl_Position = gl_Position;
+ stage_output.vColor = vColor;
+ return stage_output;
+}