From 62dda787c780d7235e625336f9ce4875bf3e45c0 Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Sat, 14 May 2016 14:21:16 +0800 Subject: [PATCH] Parser: Add missing vector relational functions for double type. --- Test/baseResults/spv.specConstant.vert.out | 6 +++--- glslang/MachineIndependent/Initialize.cpp | 24 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Test/baseResults/spv.specConstant.vert.out b/Test/baseResults/spv.specConstant.vert.out index dadab07c..fb7c70a7 100644 --- a/Test/baseResults/spv.specConstant.vert.out +++ b/Test/baseResults/spv.specConstant.vert.out @@ -16,7 +16,7 @@ Linked vertex stage: EntryPoint Vertex 4 "main" 20 22 28 53 Source GLSL 400 Name 4 "main" - Name 14 "foo(vf4[s1498];" + Name 14 "foo(vf4[s1516];" Name 13 "p" Name 17 "builtin_spec_constant(" Name 20 "color" @@ -96,10 +96,10 @@ Linked vertex stage: Store 20(color) 46 48: 10 Load 22(ucol) Store 47(param) 48 - 49: 2 FunctionCall 14(foo(vf4[s1498];) 47(param) + 49: 2 FunctionCall 14(foo(vf4[s1516];) 47(param) Return FunctionEnd -14(foo(vf4[s1498];): 2 Function None 12 +14(foo(vf4[s1516];): 2 Function None 12 13(p): 11(ptr) FunctionParameter 15: Label 54: 24(ptr) AccessChain 53(dupUcol) 23 diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 20f7c633..0edb354c 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -629,6 +629,30 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "dmat3 inverse(dmat3);" "dmat4 inverse(dmat4);" + "bvec2 lessThan(dvec2, dvec2);" + "bvec3 lessThan(dvec3, dvec3);" + "bvec4 lessThan(dvec4, dvec4);" + + "bvec2 lessThanEqual(dvec2, dvec2);" + "bvec3 lessThanEqual(dvec3, dvec3);" + "bvec4 lessThanEqual(dvec4, dvec4);" + + "bvec2 greaterThan(dvec2, dvec2);" + "bvec3 greaterThan(dvec3, dvec3);" + "bvec4 greaterThan(dvec4, dvec4);" + + "bvec2 greaterThanEqual(dvec2, dvec2);" + "bvec3 greaterThanEqual(dvec3, dvec3);" + "bvec4 greaterThanEqual(dvec4, dvec4);" + + "bvec2 equal(dvec2, dvec2);" + "bvec3 equal(dvec3, dvec3);" + "bvec4 equal(dvec4, dvec4);" + + "bvec2 notEqual(dvec2, dvec2);" + "bvec3 notEqual(dvec3, dvec3);" + "bvec4 notEqual(dvec4, dvec4);" + "\n"); }