From c9f349234f6b5b04f80aea3b6cd99b4eb5619267 Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Fri, 9 Sep 2016 17:50:07 +0800 Subject: [PATCH] SPV: Use OpBitcast to implement 4 pack/unpack built-in functions. --- SPIRV/GlslangToSpv.cpp | 3 +-- Test/baseResults/spv.int64.frag.out | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index c559142f..788dd635 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -3504,8 +3504,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: case glslang::EOpUnpackInt2x32: case glslang::EOpPackUint2x32: case glslang::EOpUnpackUint2x32: - logger->missingFunctionality("shader int64"); - libCall = spv::GLSLstd450Bad; // TODO: This is a placeholder. + unaryOp = spv::OpBitcast; break; case glslang::EOpDPdx: diff --git a/Test/baseResults/spv.int64.frag.out b/Test/baseResults/spv.int64.frag.out index b7d8ce94..1c89c034 100644 --- a/Test/baseResults/spv.int64.frag.out +++ b/Test/baseResults/spv.int64.frag.out @@ -5,7 +5,6 @@ Warning, version 450 is not yet complete; most version-specific features are pre Linked fragment stage: -Missing functionality: shader int64 // Module Version 10000 // Generated by (magic number): 80001 // Id's are bound by 478 @@ -568,15 +567,15 @@ Missing functionality: shader int64 376: 130(ivec3) Load 289(u64v) 377: 361(fvec3) Bitcast 376 Store 363(dv) 377 - 381: 14(int) ExtInst 1(GLSL.std.450) 0(Unknown) 380 + 381: 14(int) Bitcast 380 Store 279(i64) 381 383: 14(int) Load 279(i64) - 384: 72(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 383 + 384: 72(ivec2) Bitcast 383 Store 382(iv) 384 - 386: 36(int) ExtInst 1(GLSL.std.450) 0(Unknown) 385 + 386: 36(int) Bitcast 385 Store 291(u64) 386 388: 36(int) Load 291(u64) - 389: 79(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 388 + 389: 79(ivec2) Bitcast 388 Store 387(uv) 389 392: 130(ivec3) Load 289(u64v) 393: 36(int) Load 291(u64)