Parser: Type promotion for operator modulus(%) is missing.
authorRex Xu <rex.xu@amd.com>
Fri, 18 Mar 2016 08:26:23 +0000 (16:26 +0800)
committerRex Xu <rex.xu@amd.com>
Fri, 18 Mar 2016 08:26:23 +0000 (16:26 +0800)
Test/baseResults/spv.400.frag.out
Test/spv.400.frag
glslang/MachineIndependent/Intermediate.cpp

index 0cf2c36..651d67d 100644 (file)
@@ -7,7 +7,7 @@ Linked fragment stage:
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 1104
+// Id's are bound by 1112
 
                               Capability Shader
                               Capability Float64
@@ -15,7 +15,7 @@ Linked fragment stage:
                               Capability SampledRect
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 13 1025 1031 1036 1048 1074 1095 1097
+                              EntryPoint Fragment 4  "main" 13 1025 1031 1036 1048 1074 1095 1097 1103 1105
                               ExecutionMode 4 OriginUpperLeft
                               Source GLSL 400
                               SourceExtension  "GL_ARB_separate_shader_objects"
@@ -52,6 +52,8 @@ Linked fragment stage:
                               Name 1078  "isamp2DA"
                               Name 1095  "gl_FragCoord"
                               Name 1097  "vl2"
+                              Name 1103  "uo"
+                              Name 1105  "u"
                               Decorate 17(u2drs) DescriptorSet 0
                               Decorate 1023(arrayedSampler) DescriptorSet 0
                               Decorate 1025(i) Flat
@@ -60,6 +62,7 @@ Linked fragment stage:
                               Decorate 1078(isamp2DA) DescriptorSet 0
                               Decorate 1095(gl_FragCoord) BuiltIn FragCoord
                               Decorate 1097(vl2) Location 6
+                              Decorate 1105(u) Flat
                2:             TypeVoid
                3:             TypeFunction 2
               10:             TypeFloat 32
@@ -177,6 +180,10 @@ Linked fragment stage:
             1094:             TypePointer Input 11(fvec4)
 1095(gl_FragCoord):   1094(ptr) Variable Input
        1097(vl2):   1094(ptr) Variable Input
+            1102:             TypePointer Output 30(int)
+        1103(uo):   1102(ptr) Variable Output
+            1104:             TypePointer Input 30(int)
+         1105(u):   1104(ptr) Variable Input
          4(main):           2 Function None 3
                5:             Label
          1017(v):   1016(ptr) Variable Function
@@ -227,8 +234,13 @@ Linked fragment stage:
             1100:   11(fvec4) Load 13(outp)
             1101:   11(fvec4) FAdd 1100 1099
                               Store 13(outp) 1101
-            1102:           2 FunctionCall 6(foo23()
-            1103:           2 FunctionCall 8(doubles()
+            1106:     30(int) Load 1105(u)
+            1107:     23(int) Load 1025(i)
+            1108:     30(int) Bitcast 1107
+            1109:     30(int) UMod 1106 1108
+                              Store 1103(uo) 1109
+            1110:           2 FunctionCall 6(foo23()
+            1111:           2 FunctionCall 8(doubles()
                               Return
                               FunctionEnd
        6(foo23():           2 Function None 3
index 2014b5b..05b4370 100644 (file)
@@ -2,6 +2,8 @@
 \r
 in vec2 c2D;\r
 flat in int i;\r
+flat in uint u;\r
+out uint uo;\r
 out vec4 outp;\r
 out ivec4 ioutp;\r
 out uvec4 uoutp;\r
@@ -254,6 +256,7 @@ void main()
     ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i));\r
 \r
     outp += gl_FragCoord + vl2;\r
+    uo = u % i;\r
     foo23();\r
     doubles();\r
 }\r
index bafcb91..e4d21e6 100644 (file)
@@ -474,6 +474,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     case EOpSub:
     case EOpMul:
     case EOpDiv:
+    case EOpMod:
 
     case EOpVectorTimesScalar:
     case EOpVectorTimesMatrix: