Parser: Type promotion for operator modulus(%) is missing.

This commit is contained in:
Rex Xu 2016-03-18 16:26:23 +08:00
parent b1dece2737
commit 644c21025d
3 changed files with 20 additions and 4 deletions

View 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

View File

@ -2,6 +2,8 @@
in vec2 c2D;
flat in int i;
flat in uint u;
out uint uo;
out vec4 outp;
out ivec4 ioutp;
out uvec4 uoutp;
@ -254,6 +256,7 @@ void main()
ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i));
outp += gl_FragCoord + vl2;
uo = u % i;
foo23();
doubles();
}

View 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: