From eaf449631289471d2bb3ed4d9aae52f802967993 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Wed, 7 Aug 2019 01:52:20 -0600 Subject: [PATCH] Web: Complete the removal of vendor-specific #ifdef's, including CMake. --- CMakeLists.txt | 11 ----------- SPIRV/CMakeLists.txt | 16 +++------------- SPIRV/SpvBuilder.cpp | 2 +- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be55137..196194d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,11 +26,8 @@ if(NOT ${SKIP_GLSLANG_INSTALL}) endif() option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON) -option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON) option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON) -option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON) - option(ENABLE_GLSLANG_WEB "Reduces glslang to minumum needed for web use" OFF) option(ENABLE_EMSCRIPTEN_SINGLE_FILE "If using emscripten, enables SINGLE_FILE build" OFF) option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using emscripten, builds to run on Node instead of Web" OFF) @@ -67,14 +64,6 @@ project(glslang) # make testing optional include(CTest) -if(ENABLE_AMD_EXTENSIONS) - add_definitions(-DAMD_EXTENSIONS) -endif(ENABLE_AMD_EXTENSIONS) - -if(ENABLE_NV_EXTENSIONS) - add_definitions(-DNV_EXTENSIONS) -endif(ENABLE_NV_EXTENSIONS) - if(ENABLE_HLSL) add_definitions(-DENABLE_HLSL) endif(ENABLE_HLSL) diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index 594ab1e..94d2ebe 100644 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -25,24 +25,14 @@ set(HEADERS spvIR.h doc.h SpvTools.h - disassemble.h) + disassemble.h + GLSL.ext.AMD.h + GLSL.ext.NV.h) set(SPVREMAP_HEADERS SPVRemapper.h doc.h) -if(ENABLE_AMD_EXTENSIONS) - list(APPEND - HEADERS - GLSL.ext.AMD.h) -endif(ENABLE_AMD_EXTENSIONS) - -if(ENABLE_NV_EXTENSIONS) - list(APPEND - HEADERS - GLSL.ext.NV.h) -endif(ENABLE_NV_EXTENSIONS) - add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) set_property(TARGET SPIRV PROPERTY FOLDER glslang) set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 95b1f4f..52fbc63 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1826,7 +1826,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, if (parameters.component != NoResult) texArgs[numArgs++] = parameters.component; -#ifdef NV_EXTENSIONS +#ifndef GLSLANG_WEB if (parameters.granularity != NoResult) texArgs[numArgs++] = parameters.granularity; if (parameters.coarse != NoResult) -- 2.7.4