Unverified Commit fb1e40b4 by John Kessenich Committed by GitHub

Merge pull request #1299 from KhronosGroup/fix-conversions

Fix conversions
parents cb32c544 647fccaf
spv.rankShift.comp
// Module Version 10000
// Generated by (magic number): 80006
// Id's are bound by 33
Capability Shader
Capability Int64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 54 1 1
Source GLSL 450
SourceExtension "GL_ARB_gpu_shader_int64"
Name 4 "main"
Name 8 "result"
Name 11 "arg0"
Name 15 "arg1"
Decorate 11(arg0) Location 4
Decorate 15(arg1) Location 5
Decorate 32 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
6: TypeInt 64 0
7: TypePointer Function 6(int)
9: TypeInt 64 1
10: TypePointer UniformConstant 9(int)
11(arg0): 10(ptr) Variable UniformConstant
13: TypeInt 32 0
14: TypePointer UniformConstant 13(int)
15(arg1): 14(ptr) Variable UniformConstant
29: TypeVector 13(int) 3
30: 13(int) Constant 54
31: 13(int) Constant 1
32: 29(ivec3) ConstantComposite 30 31 31
4(main): 2 Function None 3
5: Label
8(result): 7(ptr) Variable Function
12: 9(int) Load 11(arg0)
16: 13(int) Load 15(arg1)
17: 9(int) ShiftLeftLogical 12 16
18: 6(int) Bitcast 17
Store 8(result) 18
19: 9(int) Load 11(arg0)
20: 13(int) Load 15(arg1)
21: 9(int) ShiftRightArithmetic 19 20
22: 6(int) Bitcast 21
Store 8(result) 22
23: 13(int) Load 15(arg1)
24: 6(int) Load 8(result)
25: 6(int) ShiftLeftLogical 24 23
Store 8(result) 25
26: 13(int) Load 15(arg1)
27: 6(int) Load 8(result)
28: 6(int) ShiftRightLogical 27 26
Store 8(result) 28
Return
FunctionEnd
...@@ -116,6 +116,8 @@ void operators() ...@@ -116,6 +116,8 @@ void operators()
i64 = i64 % i; i64 = i64 % i;
// Shift // Shift
u64v = u64v << i;
i64 = i64 >> uv.y;
u64v <<= i; u64v <<= i;
i64 >>= uv.y; i64 >>= uv.y;
......
#version 450
#extension GL_ARB_gpu_shader_int64 : require
layout(local_size_x = 54) in;
layout(location=4) uniform int64_t arg0;
layout(location=5) uniform uint arg1;
void main()
{
uint64_t result = arg0 << arg1;
result = arg0 >> arg1;
result <<= arg1;
result >>= arg1;
}
\ No newline at end of file
...@@ -459,9 +459,6 @@ public: ...@@ -459,9 +459,6 @@ public:
TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc) const; TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc) const;
TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc, const TType&) const; TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc, const TType&) const;
// Add conversion from node's type to given basic type.
TIntermTyped* convertToBasicType(TOperator op, TBasicType basicType, TIntermTyped* node) const;
// Constant folding (in Constant.cpp) // Constant folding (in Constant.cpp)
TIntermTyped* fold(TIntermAggregate* aggrNode); TIntermTyped* fold(TIntermAggregate* aggrNode);
TIntermTyped* foldConstructor(TIntermAggregate* aggrNode); TIntermTyped* foldConstructor(TIntermAggregate* aggrNode);
......
...@@ -416,6 +416,7 @@ INSTANTIATE_TEST_CASE_P( ...@@ -416,6 +416,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.460.comp", "spv.460.comp",
"spv.atomic.comp", "spv.atomic.comp",
"spv.glFragColor.frag", "spv.glFragColor.frag",
"spv.rankShift.comp",
"spv.specConst.vert", "spv.specConst.vert",
"spv.OVR_multiview.vert", "spv.OVR_multiview.vert",
})), })),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment