Second round line ending clean up, from fresh round trip.
This commit is contained in:
parent
d49d524b1c
commit
b63263267d
@ -1,96 +1,96 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
include_directories(MachineIndependent ../OGLCompilersDLL ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(WIN32)
|
||||
add_subdirectory(OSDependent/Windows)
|
||||
include_directories(${include_directories} OSDependent/Windows)
|
||||
elseif(UNIX)
|
||||
add_subdirectory(OSDependent/Linux)
|
||||
include_directories(${include_directories} OSDependent/Linux)
|
||||
else(WIN32)
|
||||
message("unkown platform")
|
||||
endif(WIN32)
|
||||
|
||||
set(SOURCES
|
||||
MachineIndependent/glslang.y
|
||||
MachineIndependent/Constant.cpp
|
||||
MachineIndependent/InfoSink.cpp
|
||||
MachineIndependent/Initialize.cpp
|
||||
MachineIndependent/IntermTraverse.cpp
|
||||
MachineIndependent/Intermediate.cpp
|
||||
MachineIndependent/ParseHelper.cpp
|
||||
MachineIndependent/PoolAlloc.cpp
|
||||
MachineIndependent/RemoveTree.cpp
|
||||
MachineIndependent/Scan.cpp
|
||||
MachineIndependent/ShaderLang.cpp
|
||||
MachineIndependent/SymbolTable.cpp
|
||||
MachineIndependent/Versions.cpp
|
||||
MachineIndependent/intermOut.cpp
|
||||
MachineIndependent/limits.cpp
|
||||
MachineIndependent/linkValidate.cpp
|
||||
MachineIndependent/parseConst.cpp
|
||||
MachineIndependent/reflection.cpp
|
||||
MachineIndependent/preprocessor/Pp.cpp
|
||||
MachineIndependent/preprocessor/PpAtom.cpp
|
||||
MachineIndependent/preprocessor/PpContext.cpp
|
||||
MachineIndependent/preprocessor/PpMemory.cpp
|
||||
MachineIndependent/preprocessor/PpScanner.cpp
|
||||
MachineIndependent/preprocessor/PpSymbols.cpp
|
||||
MachineIndependent/preprocessor/PpTokens.cpp
|
||||
GenericCodeGen/CodeGen.cpp
|
||||
GenericCodeGen/Link.cpp)
|
||||
|
||||
set(HEADERS
|
||||
Public/ShaderLang.h
|
||||
Include/BaseTypes.h
|
||||
Include/Common.h
|
||||
Include/ConstantUnion.h
|
||||
Include/InfoSink.h
|
||||
Include/InitializeGlobals.h
|
||||
Include/intermediate.h
|
||||
Include/PoolAlloc.h
|
||||
Include/ResourceLimits.h
|
||||
Include/revision.h
|
||||
Include/ShHandle.h
|
||||
Include/Types.h
|
||||
MachineIndependent/gl_types.h
|
||||
MachineIndependent/Initialize.h
|
||||
MachineIndependent/localintermediate.h
|
||||
MachineIndependent/ParseHelper.h
|
||||
MachineIndependent/reflection.h
|
||||
MachineIndependent/RemoveTree.h
|
||||
MachineIndependent/Scan.h
|
||||
MachineIndependent/ScanContext.h
|
||||
MachineIndependent/SymbolTable.h
|
||||
MachineIndependent/unistd.h
|
||||
MachineIndependent/Versions.h
|
||||
MachineIndependent/preprocessor/PpContext.h
|
||||
MachineIndependent/preprocessor/PpTokens.h)
|
||||
|
||||
find_package(BISON)
|
||||
if(NOT BISON_FOUND)
|
||||
set(BISON_EXECUTABLE ../tools/bison.exe)
|
||||
message("bison not found. Assuming it is at ${BISON_EXECUTABLE}")
|
||||
endif()
|
||||
|
||||
# Always use a custom command since our use of --defines isn't assumed by CMake's BISON_TARGET,
|
||||
# which ends up causing the target to always be rebuilt.
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h
|
||||
COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h -t MachineIndependent/glslang.y -o ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp
|
||||
MAIN_DEPENDENCY MachineIndependent/glslang.y
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp)
|
||||
|
||||
add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
|
||||
|
||||
if(WIN32)
|
||||
source_group("Public" REGULAR_EXPRESSION "Public/*")
|
||||
source_group("MachineIndependent" REGULAR_EXPRESSION "MachineIndependent/[^/]*")
|
||||
source_group("Generated Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h)
|
||||
source_group("Include" REGULAR_EXPRESSION "Include/[^/]*")
|
||||
source_group("GenericCodeGen" REGULAR_EXPRESSION "GenericCodeGen/*")
|
||||
source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*")
|
||||
endif(WIN32)
|
||||
|
||||
install(TARGETS glslang
|
||||
ARCHIVE DESTINATION lib)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
include_directories(MachineIndependent ../OGLCompilersDLL ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(WIN32)
|
||||
add_subdirectory(OSDependent/Windows)
|
||||
include_directories(${include_directories} OSDependent/Windows)
|
||||
elseif(UNIX)
|
||||
add_subdirectory(OSDependent/Linux)
|
||||
include_directories(${include_directories} OSDependent/Linux)
|
||||
else(WIN32)
|
||||
message("unkown platform")
|
||||
endif(WIN32)
|
||||
|
||||
set(SOURCES
|
||||
MachineIndependent/glslang.y
|
||||
MachineIndependent/Constant.cpp
|
||||
MachineIndependent/InfoSink.cpp
|
||||
MachineIndependent/Initialize.cpp
|
||||
MachineIndependent/IntermTraverse.cpp
|
||||
MachineIndependent/Intermediate.cpp
|
||||
MachineIndependent/ParseHelper.cpp
|
||||
MachineIndependent/PoolAlloc.cpp
|
||||
MachineIndependent/RemoveTree.cpp
|
||||
MachineIndependent/Scan.cpp
|
||||
MachineIndependent/ShaderLang.cpp
|
||||
MachineIndependent/SymbolTable.cpp
|
||||
MachineIndependent/Versions.cpp
|
||||
MachineIndependent/intermOut.cpp
|
||||
MachineIndependent/limits.cpp
|
||||
MachineIndependent/linkValidate.cpp
|
||||
MachineIndependent/parseConst.cpp
|
||||
MachineIndependent/reflection.cpp
|
||||
MachineIndependent/preprocessor/Pp.cpp
|
||||
MachineIndependent/preprocessor/PpAtom.cpp
|
||||
MachineIndependent/preprocessor/PpContext.cpp
|
||||
MachineIndependent/preprocessor/PpMemory.cpp
|
||||
MachineIndependent/preprocessor/PpScanner.cpp
|
||||
MachineIndependent/preprocessor/PpSymbols.cpp
|
||||
MachineIndependent/preprocessor/PpTokens.cpp
|
||||
GenericCodeGen/CodeGen.cpp
|
||||
GenericCodeGen/Link.cpp)
|
||||
|
||||
set(HEADERS
|
||||
Public/ShaderLang.h
|
||||
Include/BaseTypes.h
|
||||
Include/Common.h
|
||||
Include/ConstantUnion.h
|
||||
Include/InfoSink.h
|
||||
Include/InitializeGlobals.h
|
||||
Include/intermediate.h
|
||||
Include/PoolAlloc.h
|
||||
Include/ResourceLimits.h
|
||||
Include/revision.h
|
||||
Include/ShHandle.h
|
||||
Include/Types.h
|
||||
MachineIndependent/gl_types.h
|
||||
MachineIndependent/Initialize.h
|
||||
MachineIndependent/localintermediate.h
|
||||
MachineIndependent/ParseHelper.h
|
||||
MachineIndependent/reflection.h
|
||||
MachineIndependent/RemoveTree.h
|
||||
MachineIndependent/Scan.h
|
||||
MachineIndependent/ScanContext.h
|
||||
MachineIndependent/SymbolTable.h
|
||||
MachineIndependent/unistd.h
|
||||
MachineIndependent/Versions.h
|
||||
MachineIndependent/preprocessor/PpContext.h
|
||||
MachineIndependent/preprocessor/PpTokens.h)
|
||||
|
||||
find_package(BISON)
|
||||
if(NOT BISON_FOUND)
|
||||
set(BISON_EXECUTABLE ../tools/bison.exe)
|
||||
message("bison not found. Assuming it is at ${BISON_EXECUTABLE}")
|
||||
endif()
|
||||
|
||||
# Always use a custom command since our use of --defines isn't assumed by CMake's BISON_TARGET,
|
||||
# which ends up causing the target to always be rebuilt.
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h
|
||||
COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h -t MachineIndependent/glslang.y -o ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp
|
||||
MAIN_DEPENDENCY MachineIndependent/glslang.y
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp)
|
||||
|
||||
add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
|
||||
|
||||
if(WIN32)
|
||||
source_group("Public" REGULAR_EXPRESSION "Public/*")
|
||||
source_group("MachineIndependent" REGULAR_EXPRESSION "MachineIndependent/[^/]*")
|
||||
source_group("Generated Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h)
|
||||
source_group("Include" REGULAR_EXPRESSION "Include/[^/]*")
|
||||
source_group("GenericCodeGen" REGULAR_EXPRESSION "GenericCodeGen/*")
|
||||
source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*")
|
||||
endif(WIN32)
|
||||
|
||||
install(TARGETS glslang
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
// The file revision.h should be updated to the latest version, somehow, on
|
||||
// check-in, if glslang has changed.
|
||||
//
|
||||
// revision.template is the source for revision.h when using SubWCRev as the
|
||||
// method of updating revision.h. You don't have to do it this way, the
|
||||
// requirement is only that revision.h gets updated.
|
||||
//
|
||||
// revision.h is under source control so that not all consumers of glslang
|
||||
// source have to figure out how to create revision.h just to get a build
|
||||
// going. However, if it is not updated, it can be a version behind.
|
||||
|
||||
#define GLSLANG_REVISION "25512"
|
||||
#define GLSLANG_DATE "2014/02/24 14:36:08"
|
||||
// The file revision.h should be updated to the latest version, somehow, on
|
||||
// check-in, if glslang has changed.
|
||||
//
|
||||
// revision.template is the source for revision.h when using SubWCRev as the
|
||||
// method of updating revision.h. You don't have to do it this way, the
|
||||
// requirement is only that revision.h gets updated.
|
||||
//
|
||||
// revision.h is under source control so that not all consumers of glslang
|
||||
// source have to figure out how to create revision.h just to get a build
|
||||
// going. However, if it is not updated, it can be a version behind.
|
||||
|
||||
#define GLSLANG_REVISION "25512"
|
||||
#define GLSLANG_DATE "2014/02/24 14:36:08"
|
||||
|
||||
@ -1,150 +1,150 @@
|
||||
/*
|
||||
** Copyright (c) 2013 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_FLOAT_VEC2 0x8B50
|
||||
#define GL_FLOAT_VEC3 0x8B51
|
||||
#define GL_FLOAT_VEC4 0x8B52
|
||||
|
||||
#define GL_DOUBLE 0x140A
|
||||
#define GL_DOUBLE_VEC2 0x8FFC
|
||||
#define GL_DOUBLE_VEC3 0x8FFD
|
||||
#define GL_DOUBLE_VEC4 0x8FFE
|
||||
|
||||
#define GL_INT 0x1404
|
||||
#define GL_INT_VEC2 0x8B53
|
||||
#define GL_INT_VEC3 0x8B54
|
||||
#define GL_INT_VEC4 0x8B55
|
||||
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#define GL_UNSIGNED_INT_VEC2 0x8DC6
|
||||
#define GL_UNSIGNED_INT_VEC3 0x8DC7
|
||||
#define GL_UNSIGNED_INT_VEC4 0x8DC8
|
||||
|
||||
#define GL_BOOL 0x8B56
|
||||
#define GL_BOOL_VEC2 0x8B57
|
||||
#define GL_BOOL_VEC3 0x8B58
|
||||
#define GL_BOOL_VEC4 0x8B59
|
||||
|
||||
#define GL_FLOAT_MAT2 0x8B5A
|
||||
#define GL_FLOAT_MAT3 0x8B5B
|
||||
#define GL_FLOAT_MAT4 0x8B5C
|
||||
#define GL_FLOAT_MAT2x3 0x8B65
|
||||
#define GL_FLOAT_MAT2x4 0x8B66
|
||||
#define GL_FLOAT_MAT3x2 0x8B67
|
||||
#define GL_FLOAT_MAT3x4 0x8B68
|
||||
#define GL_FLOAT_MAT4x2 0x8B69
|
||||
#define GL_FLOAT_MAT4x3 0x8B6A
|
||||
|
||||
#define GL_DOUBLE_MAT2 0x8F46
|
||||
#define GL_DOUBLE_MAT3 0x8F47
|
||||
#define GL_DOUBLE_MAT4 0x8F48
|
||||
#define GL_DOUBLE_MAT2x3 0x8F49
|
||||
#define GL_DOUBLE_MAT2x4 0x8F4A
|
||||
#define GL_DOUBLE_MAT3x2 0x8F4B
|
||||
#define GL_DOUBLE_MAT3x4 0x8F4C
|
||||
#define GL_DOUBLE_MAT4x2 0x8F4D
|
||||
#define GL_DOUBLE_MAT4x3 0x8F4E
|
||||
|
||||
#define GL_SAMPLER_1D 0x8B5D
|
||||
#define GL_SAMPLER_2D 0x8B5E
|
||||
#define GL_SAMPLER_3D 0x8B5F
|
||||
#define GL_SAMPLER_CUBE 0x8B60
|
||||
#define GL_SAMPLER_BUFFER 0x8DC2
|
||||
#define GL_SAMPLER_1D_ARRAY 0x8DC0
|
||||
#define GL_SAMPLER_2D_ARRAY 0x8DC1
|
||||
#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
|
||||
#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
|
||||
#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
|
||||
#define GL_SAMPLER_1D_SHADOW 0x8B61
|
||||
#define GL_SAMPLER_2D_SHADOW 0x8B62
|
||||
#define GL_SAMPLER_2D_RECT 0x8B63
|
||||
#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
|
||||
#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
|
||||
#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
|
||||
|
||||
#define GL_INT_SAMPLER_1D 0x8DC9
|
||||
#define GL_INT_SAMPLER_2D 0x8DCA
|
||||
#define GL_INT_SAMPLER_3D 0x8DCB
|
||||
#define GL_INT_SAMPLER_CUBE 0x8DCC
|
||||
#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
|
||||
#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
|
||||
#define GL_INT_SAMPLER_2D_RECT 0x8DCD
|
||||
#define GL_INT_SAMPLER_BUFFER 0x8DD0
|
||||
#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
|
||||
#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
|
||||
#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
|
||||
#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
|
||||
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
|
||||
#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
|
||||
#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
|
||||
|
||||
#define GL_IMAGE_1D 0x904C
|
||||
#define GL_IMAGE_2D 0x904D
|
||||
#define GL_IMAGE_3D 0x904E
|
||||
#define GL_IMAGE_2D_RECT 0x904F
|
||||
#define GL_IMAGE_CUBE 0x9050
|
||||
#define GL_IMAGE_BUFFER 0x9051
|
||||
#define GL_IMAGE_1D_ARRAY 0x9052
|
||||
#define GL_IMAGE_2D_ARRAY 0x9053
|
||||
#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
|
||||
#define GL_IMAGE_2D_MULTISAMPLE 0x9055
|
||||
#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
|
||||
#define GL_INT_IMAGE_1D 0x9057
|
||||
#define GL_INT_IMAGE_2D 0x9058
|
||||
#define GL_INT_IMAGE_3D 0x9059
|
||||
#define GL_INT_IMAGE_2D_RECT 0x905A
|
||||
#define GL_INT_IMAGE_CUBE 0x905B
|
||||
#define GL_INT_IMAGE_BUFFER 0x905C
|
||||
#define GL_INT_IMAGE_1D_ARRAY 0x905D
|
||||
#define GL_INT_IMAGE_2D_ARRAY 0x905E
|
||||
#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
|
||||
#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
|
||||
#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
|
||||
#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
|
||||
#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
|
||||
#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
|
||||
#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
|
||||
#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
|
||||
#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
|
||||
|
||||
#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
|
||||
/*
|
||||
** Copyright (c) 2013 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_FLOAT_VEC2 0x8B50
|
||||
#define GL_FLOAT_VEC3 0x8B51
|
||||
#define GL_FLOAT_VEC4 0x8B52
|
||||
|
||||
#define GL_DOUBLE 0x140A
|
||||
#define GL_DOUBLE_VEC2 0x8FFC
|
||||
#define GL_DOUBLE_VEC3 0x8FFD
|
||||
#define GL_DOUBLE_VEC4 0x8FFE
|
||||
|
||||
#define GL_INT 0x1404
|
||||
#define GL_INT_VEC2 0x8B53
|
||||
#define GL_INT_VEC3 0x8B54
|
||||
#define GL_INT_VEC4 0x8B55
|
||||
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#define GL_UNSIGNED_INT_VEC2 0x8DC6
|
||||
#define GL_UNSIGNED_INT_VEC3 0x8DC7
|
||||
#define GL_UNSIGNED_INT_VEC4 0x8DC8
|
||||
|
||||
#define GL_BOOL 0x8B56
|
||||
#define GL_BOOL_VEC2 0x8B57
|
||||
#define GL_BOOL_VEC3 0x8B58
|
||||
#define GL_BOOL_VEC4 0x8B59
|
||||
|
||||
#define GL_FLOAT_MAT2 0x8B5A
|
||||
#define GL_FLOAT_MAT3 0x8B5B
|
||||
#define GL_FLOAT_MAT4 0x8B5C
|
||||
#define GL_FLOAT_MAT2x3 0x8B65
|
||||
#define GL_FLOAT_MAT2x4 0x8B66
|
||||
#define GL_FLOAT_MAT3x2 0x8B67
|
||||
#define GL_FLOAT_MAT3x4 0x8B68
|
||||
#define GL_FLOAT_MAT4x2 0x8B69
|
||||
#define GL_FLOAT_MAT4x3 0x8B6A
|
||||
|
||||
#define GL_DOUBLE_MAT2 0x8F46
|
||||
#define GL_DOUBLE_MAT3 0x8F47
|
||||
#define GL_DOUBLE_MAT4 0x8F48
|
||||
#define GL_DOUBLE_MAT2x3 0x8F49
|
||||
#define GL_DOUBLE_MAT2x4 0x8F4A
|
||||
#define GL_DOUBLE_MAT3x2 0x8F4B
|
||||
#define GL_DOUBLE_MAT3x4 0x8F4C
|
||||
#define GL_DOUBLE_MAT4x2 0x8F4D
|
||||
#define GL_DOUBLE_MAT4x3 0x8F4E
|
||||
|
||||
#define GL_SAMPLER_1D 0x8B5D
|
||||
#define GL_SAMPLER_2D 0x8B5E
|
||||
#define GL_SAMPLER_3D 0x8B5F
|
||||
#define GL_SAMPLER_CUBE 0x8B60
|
||||
#define GL_SAMPLER_BUFFER 0x8DC2
|
||||
#define GL_SAMPLER_1D_ARRAY 0x8DC0
|
||||
#define GL_SAMPLER_2D_ARRAY 0x8DC1
|
||||
#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
|
||||
#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
|
||||
#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
|
||||
#define GL_SAMPLER_1D_SHADOW 0x8B61
|
||||
#define GL_SAMPLER_2D_SHADOW 0x8B62
|
||||
#define GL_SAMPLER_2D_RECT 0x8B63
|
||||
#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
|
||||
#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
|
||||
#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
|
||||
|
||||
#define GL_INT_SAMPLER_1D 0x8DC9
|
||||
#define GL_INT_SAMPLER_2D 0x8DCA
|
||||
#define GL_INT_SAMPLER_3D 0x8DCB
|
||||
#define GL_INT_SAMPLER_CUBE 0x8DCC
|
||||
#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
|
||||
#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
|
||||
#define GL_INT_SAMPLER_2D_RECT 0x8DCD
|
||||
#define GL_INT_SAMPLER_BUFFER 0x8DD0
|
||||
#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
|
||||
#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
|
||||
#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
|
||||
#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
|
||||
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
|
||||
#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
|
||||
#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
|
||||
|
||||
#define GL_IMAGE_1D 0x904C
|
||||
#define GL_IMAGE_2D 0x904D
|
||||
#define GL_IMAGE_3D 0x904E
|
||||
#define GL_IMAGE_2D_RECT 0x904F
|
||||
#define GL_IMAGE_CUBE 0x9050
|
||||
#define GL_IMAGE_BUFFER 0x9051
|
||||
#define GL_IMAGE_1D_ARRAY 0x9052
|
||||
#define GL_IMAGE_2D_ARRAY 0x9053
|
||||
#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
|
||||
#define GL_IMAGE_2D_MULTISAMPLE 0x9055
|
||||
#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
|
||||
#define GL_INT_IMAGE_1D 0x9057
|
||||
#define GL_INT_IMAGE_2D 0x9058
|
||||
#define GL_INT_IMAGE_3D 0x9059
|
||||
#define GL_INT_IMAGE_2D_RECT 0x905A
|
||||
#define GL_INT_IMAGE_CUBE 0x905B
|
||||
#define GL_INT_IMAGE_BUFFER 0x905C
|
||||
#define GL_INT_IMAGE_1D_ARRAY 0x905D
|
||||
#define GL_INT_IMAGE_2D_ARRAY 0x905E
|
||||
#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
|
||||
#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
|
||||
#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
|
||||
#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
|
||||
#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
|
||||
#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
|
||||
#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
|
||||
#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
|
||||
#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
|
||||
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
|
||||
|
||||
#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
|
||||
|
||||
@ -1,198 +1,198 @@
|
||||
//
|
||||
//Copyright (C) 2013 LunarG, Inc.
|
||||
//
|
||||
//All rights reserved.
|
||||
//
|
||||
//Redistribution and use in source and binary forms, with or without
|
||||
//modification, are permitted provided that the following conditions
|
||||
//are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following
|
||||
// disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
//POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
//
|
||||
// Do sub tree walks for
|
||||
// 1) inductive loop bodies to see if the inductive variable is modified
|
||||
// 2) array-index expressions to see if they are "constant-index-expression"
|
||||
//
|
||||
// These are per Appendix A of ES 2.0:
|
||||
//
|
||||
// "Within the body of the loop, the loop index is not statically assigned to nor is it used as the
|
||||
// argument to a function out or inout parameter."
|
||||
//
|
||||
// "The following are constant-index-expressions:
|
||||
// - Constant expressions
|
||||
// - Loop indices as defined in section 4
|
||||
// - Expressions composed of both of the above"
|
||||
//
|
||||
// N.B.: assuming the last rule excludes function calls
|
||||
//
|
||||
|
||||
#include "ParseHelper.h"
|
||||
|
||||
namespace glslang {
|
||||
|
||||
//
|
||||
// The inductive loop-body traverser.
|
||||
//
|
||||
// Just look at things that might modify the loop index.
|
||||
//
|
||||
|
||||
class TInductiveTraverser : public TIntermTraverser {
|
||||
public:
|
||||
TInductiveTraverser(int id, TSymbolTable& st)
|
||||
: loopId(id), symbolTable(st), bad(false) { }
|
||||
|
||||
virtual bool visitBinary(TVisit, TIntermBinary* node);
|
||||
virtual bool visitUnary(TVisit, TIntermUnary* node);
|
||||
virtual bool visitAggregate(TVisit, TIntermAggregate* node);
|
||||
|
||||
int loopId; // unique ID of the symbol that's the loop inductive variable
|
||||
TSymbolTable& symbolTable;
|
||||
bool bad;
|
||||
TSourceLoc badLoc;
|
||||
|
||||
protected:
|
||||
TInductiveTraverser(TInductiveTraverser&);
|
||||
TInductiveTraverser& operator=(TInductiveTraverser&);
|
||||
};
|
||||
|
||||
// check binary operations for those modifying the loop index
|
||||
bool TInductiveTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
|
||||
{
|
||||
if (node->modifiesState() && node->getLeft()->getAsSymbolNode() &&
|
||||
node->getLeft()->getAsSymbolNode()->getId() == loopId) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// check unary operations for those modifying the loop index
|
||||
bool TInductiveTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
{
|
||||
if (node->modifiesState() && node->getOperand()->getAsSymbolNode() &&
|
||||
node->getOperand()->getAsSymbolNode()->getId() == loopId) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// check function calls for arguments modifying the loop index
|
||||
bool TInductiveTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
|
||||
{
|
||||
if (node->getOp() == EOpFunctionCall) {
|
||||
// see if an out or inout argument is the loop index
|
||||
const TIntermSequence& args = node->getSequence();
|
||||
for (int i = 0; i < (int)args.size(); ++i) {
|
||||
if (args[i]->getAsSymbolNode() && args[i]->getAsSymbolNode()->getId() == loopId) {
|
||||
TSymbol* function = symbolTable.find(node->getName());
|
||||
const TType* type = (*function->getAsFunction())[i].type;
|
||||
if (type->getQualifier().storage == EvqOut ||
|
||||
type->getQualifier().storage == EvqInOut) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// External function to call for loop check.
|
||||
//
|
||||
void TParseContext::inductiveLoopBodyCheck(TIntermNode* body, int loopId, TSymbolTable& symbolTable)
|
||||
{
|
||||
TInductiveTraverser it(loopId, symbolTable);
|
||||
|
||||
if (! body)
|
||||
return;
|
||||
|
||||
body->traverse(&it);
|
||||
|
||||
if (it.bad)
|
||||
error(it.badLoc, "inductive loop index modified", "limitations", "");
|
||||
}
|
||||
|
||||
//
|
||||
// The "constant-index-expression" tranverser.
|
||||
//
|
||||
// Just look at things that can form an index.
|
||||
//
|
||||
|
||||
class TIndexTraverser : public TIntermTraverser {
|
||||
public:
|
||||
TIndexTraverser(const TIdSetType& ids) : inductiveLoopIds(ids), bad(false) { }
|
||||
virtual void visitSymbol(TIntermSymbol* symbol);
|
||||
virtual bool visitAggregate(TVisit, TIntermAggregate* node);
|
||||
const TIdSetType& inductiveLoopIds;
|
||||
bool bad;
|
||||
TSourceLoc badLoc;
|
||||
|
||||
protected:
|
||||
TIndexTraverser(TIndexTraverser&);
|
||||
TIndexTraverser& operator=(TIndexTraverser&);
|
||||
};
|
||||
|
||||
// make sure symbols are inductive-loop indexes
|
||||
void TIndexTraverser::visitSymbol(TIntermSymbol* symbol)
|
||||
{
|
||||
if (inductiveLoopIds.find(symbol->getId()) == inductiveLoopIds.end()) {
|
||||
bad = true;
|
||||
badLoc = symbol->getLoc();
|
||||
}
|
||||
}
|
||||
|
||||
// check for function calls, assuming they are bad; spec. doesn't really say
|
||||
bool TIndexTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
|
||||
{
|
||||
if (node->getOp() == EOpFunctionCall) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// External function to call for loop check.
|
||||
//
|
||||
void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
|
||||
{
|
||||
TIndexTraverser it(inductiveLoopIds);
|
||||
|
||||
index->traverse(&it);
|
||||
|
||||
if (it.bad)
|
||||
error(it.badLoc, "Non-constant-index-expression", "limitations", "");
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
//
|
||||
//Copyright (C) 2013 LunarG, Inc.
|
||||
//
|
||||
//All rights reserved.
|
||||
//
|
||||
//Redistribution and use in source and binary forms, with or without
|
||||
//modification, are permitted provided that the following conditions
|
||||
//are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following
|
||||
// disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
//POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
//
|
||||
// Do sub tree walks for
|
||||
// 1) inductive loop bodies to see if the inductive variable is modified
|
||||
// 2) array-index expressions to see if they are "constant-index-expression"
|
||||
//
|
||||
// These are per Appendix A of ES 2.0:
|
||||
//
|
||||
// "Within the body of the loop, the loop index is not statically assigned to nor is it used as the
|
||||
// argument to a function out or inout parameter."
|
||||
//
|
||||
// "The following are constant-index-expressions:
|
||||
// - Constant expressions
|
||||
// - Loop indices as defined in section 4
|
||||
// - Expressions composed of both of the above"
|
||||
//
|
||||
// N.B.: assuming the last rule excludes function calls
|
||||
//
|
||||
|
||||
#include "ParseHelper.h"
|
||||
|
||||
namespace glslang {
|
||||
|
||||
//
|
||||
// The inductive loop-body traverser.
|
||||
//
|
||||
// Just look at things that might modify the loop index.
|
||||
//
|
||||
|
||||
class TInductiveTraverser : public TIntermTraverser {
|
||||
public:
|
||||
TInductiveTraverser(int id, TSymbolTable& st)
|
||||
: loopId(id), symbolTable(st), bad(false) { }
|
||||
|
||||
virtual bool visitBinary(TVisit, TIntermBinary* node);
|
||||
virtual bool visitUnary(TVisit, TIntermUnary* node);
|
||||
virtual bool visitAggregate(TVisit, TIntermAggregate* node);
|
||||
|
||||
int loopId; // unique ID of the symbol that's the loop inductive variable
|
||||
TSymbolTable& symbolTable;
|
||||
bool bad;
|
||||
TSourceLoc badLoc;
|
||||
|
||||
protected:
|
||||
TInductiveTraverser(TInductiveTraverser&);
|
||||
TInductiveTraverser& operator=(TInductiveTraverser&);
|
||||
};
|
||||
|
||||
// check binary operations for those modifying the loop index
|
||||
bool TInductiveTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
|
||||
{
|
||||
if (node->modifiesState() && node->getLeft()->getAsSymbolNode() &&
|
||||
node->getLeft()->getAsSymbolNode()->getId() == loopId) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// check unary operations for those modifying the loop index
|
||||
bool TInductiveTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
{
|
||||
if (node->modifiesState() && node->getOperand()->getAsSymbolNode() &&
|
||||
node->getOperand()->getAsSymbolNode()->getId() == loopId) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// check function calls for arguments modifying the loop index
|
||||
bool TInductiveTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
|
||||
{
|
||||
if (node->getOp() == EOpFunctionCall) {
|
||||
// see if an out or inout argument is the loop index
|
||||
const TIntermSequence& args = node->getSequence();
|
||||
for (int i = 0; i < (int)args.size(); ++i) {
|
||||
if (args[i]->getAsSymbolNode() && args[i]->getAsSymbolNode()->getId() == loopId) {
|
||||
TSymbol* function = symbolTable.find(node->getName());
|
||||
const TType* type = (*function->getAsFunction())[i].type;
|
||||
if (type->getQualifier().storage == EvqOut ||
|
||||
type->getQualifier().storage == EvqInOut) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// External function to call for loop check.
|
||||
//
|
||||
void TParseContext::inductiveLoopBodyCheck(TIntermNode* body, int loopId, TSymbolTable& symbolTable)
|
||||
{
|
||||
TInductiveTraverser it(loopId, symbolTable);
|
||||
|
||||
if (! body)
|
||||
return;
|
||||
|
||||
body->traverse(&it);
|
||||
|
||||
if (it.bad)
|
||||
error(it.badLoc, "inductive loop index modified", "limitations", "");
|
||||
}
|
||||
|
||||
//
|
||||
// The "constant-index-expression" tranverser.
|
||||
//
|
||||
// Just look at things that can form an index.
|
||||
//
|
||||
|
||||
class TIndexTraverser : public TIntermTraverser {
|
||||
public:
|
||||
TIndexTraverser(const TIdSetType& ids) : inductiveLoopIds(ids), bad(false) { }
|
||||
virtual void visitSymbol(TIntermSymbol* symbol);
|
||||
virtual bool visitAggregate(TVisit, TIntermAggregate* node);
|
||||
const TIdSetType& inductiveLoopIds;
|
||||
bool bad;
|
||||
TSourceLoc badLoc;
|
||||
|
||||
protected:
|
||||
TIndexTraverser(TIndexTraverser&);
|
||||
TIndexTraverser& operator=(TIndexTraverser&);
|
||||
};
|
||||
|
||||
// make sure symbols are inductive-loop indexes
|
||||
void TIndexTraverser::visitSymbol(TIntermSymbol* symbol)
|
||||
{
|
||||
if (inductiveLoopIds.find(symbol->getId()) == inductiveLoopIds.end()) {
|
||||
bad = true;
|
||||
badLoc = symbol->getLoc();
|
||||
}
|
||||
}
|
||||
|
||||
// check for function calls, assuming they are bad; spec. doesn't really say
|
||||
bool TIndexTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
|
||||
{
|
||||
if (node->getOp() == EOpFunctionCall) {
|
||||
bad = true;
|
||||
badLoc = node->getLoc();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// External function to call for loop check.
|
||||
//
|
||||
void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
|
||||
{
|
||||
TIndexTraverser it(inductiveLoopIds);
|
||||
|
||||
index->traverse(&it);
|
||||
|
||||
if (it.bad)
|
||||
error(it.badLoc, "Non-constant-index-expression", "limitations", "");
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,122 +1,122 @@
|
||||
//
|
||||
//Copyright (C) 2013 LunarG, Inc.
|
||||
//
|
||||
//All rights reserved.
|
||||
//
|
||||
//Redistribution and use in source and binary forms, with or without
|
||||
//modification, are permitted provided that the following conditions
|
||||
//are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following
|
||||
// disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
//POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef _REFLECTION_INCLUDED
|
||||
#define _REFLECTION_INCLUDED
|
||||
|
||||
#include "../Public/ShaderLang.h"
|
||||
|
||||
#include <list>
|
||||
#include <set>
|
||||
|
||||
//
|
||||
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
|
||||
//
|
||||
|
||||
namespace glslang {
|
||||
|
||||
class TIntermediate;
|
||||
class TIntermAggregate;
|
||||
class TLiveTraverser;
|
||||
|
||||
// Data needed for just a single object at the granularity exchanged by the reflection API
|
||||
class TObjectReflection {
|
||||
public:
|
||||
TObjectReflection(const TString& pName, int pOffset, int pGLDefineType, int pSize, int pIndex) :
|
||||
name(pName), offset(pOffset), glDefineType(pGLDefineType), size(pSize), index(pIndex) { }
|
||||
void dump() const { printf("%s: offset %d, type %x, size %d, index %d\n", name.c_str(), offset, glDefineType, size, index); }
|
||||
TString name;
|
||||
int offset;
|
||||
int glDefineType;
|
||||
int size; // data size in bytes for a block, array size for a (non-block) object that's an array
|
||||
int index;
|
||||
};
|
||||
|
||||
// The full reflection database
|
||||
class TReflection {
|
||||
public:
|
||||
TReflection() : badReflection("__bad__", -1, -1, -1, -1) {}
|
||||
virtual ~TReflection() {}
|
||||
|
||||
// grow the reflection stage by stage
|
||||
bool addStage(EShLanguage, const TIntermediate&);
|
||||
|
||||
// for mapping a uniform index to a uniform object's description
|
||||
int getNumUniforms() { return (int)indexToUniform.size(); }
|
||||
const TObjectReflection& getUniform(int i) const
|
||||
{
|
||||
if (i >= 0 && i < (int)indexToUniform.size())
|
||||
return indexToUniform[i];
|
||||
else
|
||||
return badReflection;
|
||||
}
|
||||
|
||||
// for mapping a block index to the block's description
|
||||
int getNumUniformBlocks() const { return (int)indexToUniformBlock.size(); }
|
||||
const TObjectReflection& getUniformBlock(int i) const
|
||||
{
|
||||
if (i >= 0 && i < (int)indexToUniformBlock.size())
|
||||
return indexToUniformBlock[i];
|
||||
else
|
||||
return badReflection;
|
||||
}
|
||||
|
||||
// for mapping any name to its index (both block names and uniforms names)
|
||||
int getIndex(const char* name) const
|
||||
{
|
||||
TNameToIndex::const_iterator it = nameToIndex.find(name);
|
||||
if (it == nameToIndex.end())
|
||||
return -1;
|
||||
else
|
||||
return it->second;
|
||||
}
|
||||
|
||||
void dump();
|
||||
|
||||
protected:
|
||||
friend class glslang::TLiveTraverser;
|
||||
|
||||
typedef std::map<TString, int> TNameToIndex;
|
||||
typedef std::vector<TObjectReflection> TMapIndexToReflection;
|
||||
|
||||
TObjectReflection badReflection; // return for queries of -1 or generally out of range; has expected descriptions with in it for this
|
||||
TNameToIndex nameToIndex; // maps names to indexes; can hold all types of data: uniform/buffer and which function names have been processed
|
||||
TMapIndexToReflection indexToUniform;
|
||||
TMapIndexToReflection indexToUniformBlock;
|
||||
};
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // _REFLECTION_INCLUDED
|
||||
//
|
||||
//Copyright (C) 2013 LunarG, Inc.
|
||||
//
|
||||
//All rights reserved.
|
||||
//
|
||||
//Redistribution and use in source and binary forms, with or without
|
||||
//modification, are permitted provided that the following conditions
|
||||
//are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following
|
||||
// disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
//POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef _REFLECTION_INCLUDED
|
||||
#define _REFLECTION_INCLUDED
|
||||
|
||||
#include "../Public/ShaderLang.h"
|
||||
|
||||
#include <list>
|
||||
#include <set>
|
||||
|
||||
//
|
||||
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
|
||||
//
|
||||
|
||||
namespace glslang {
|
||||
|
||||
class TIntermediate;
|
||||
class TIntermAggregate;
|
||||
class TLiveTraverser;
|
||||
|
||||
// Data needed for just a single object at the granularity exchanged by the reflection API
|
||||
class TObjectReflection {
|
||||
public:
|
||||
TObjectReflection(const TString& pName, int pOffset, int pGLDefineType, int pSize, int pIndex) :
|
||||
name(pName), offset(pOffset), glDefineType(pGLDefineType), size(pSize), index(pIndex) { }
|
||||
void dump() const { printf("%s: offset %d, type %x, size %d, index %d\n", name.c_str(), offset, glDefineType, size, index); }
|
||||
TString name;
|
||||
int offset;
|
||||
int glDefineType;
|
||||
int size; // data size in bytes for a block, array size for a (non-block) object that's an array
|
||||
int index;
|
||||
};
|
||||
|
||||
// The full reflection database
|
||||
class TReflection {
|
||||
public:
|
||||
TReflection() : badReflection("__bad__", -1, -1, -1, -1) {}
|
||||
virtual ~TReflection() {}
|
||||
|
||||
// grow the reflection stage by stage
|
||||
bool addStage(EShLanguage, const TIntermediate&);
|
||||
|
||||
// for mapping a uniform index to a uniform object's description
|
||||
int getNumUniforms() { return (int)indexToUniform.size(); }
|
||||
const TObjectReflection& getUniform(int i) const
|
||||
{
|
||||
if (i >= 0 && i < (int)indexToUniform.size())
|
||||
return indexToUniform[i];
|
||||
else
|
||||
return badReflection;
|
||||
}
|
||||
|
||||
// for mapping a block index to the block's description
|
||||
int getNumUniformBlocks() const { return (int)indexToUniformBlock.size(); }
|
||||
const TObjectReflection& getUniformBlock(int i) const
|
||||
{
|
||||
if (i >= 0 && i < (int)indexToUniformBlock.size())
|
||||
return indexToUniformBlock[i];
|
||||
else
|
||||
return badReflection;
|
||||
}
|
||||
|
||||
// for mapping any name to its index (both block names and uniforms names)
|
||||
int getIndex(const char* name) const
|
||||
{
|
||||
TNameToIndex::const_iterator it = nameToIndex.find(name);
|
||||
if (it == nameToIndex.end())
|
||||
return -1;
|
||||
else
|
||||
return it->second;
|
||||
}
|
||||
|
||||
void dump();
|
||||
|
||||
protected:
|
||||
friend class glslang::TLiveTraverser;
|
||||
|
||||
typedef std::map<TString, int> TNameToIndex;
|
||||
typedef std::vector<TObjectReflection> TMapIndexToReflection;
|
||||
|
||||
TObjectReflection badReflection; // return for queries of -1 or generally out of range; has expected descriptions with in it for this
|
||||
TNameToIndex nameToIndex; // maps names to indexes; can hold all types of data: uniform/buffer and which function names have been processed
|
||||
TMapIndexToReflection indexToUniform;
|
||||
TMapIndexToReflection indexToUniformBlock;
|
||||
};
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // _REFLECTION_INCLUDED
|
||||
|
||||
@ -6,5 +6,5 @@ include_directories(. ../../../OGLCompilersDLL)
|
||||
|
||||
add_library(OSDependent STATIC ossource.cpp osinclude.h)
|
||||
|
||||
install(TARGETS OSDependent
|
||||
ARCHIVE DESTINATION lib)
|
||||
install(TARGETS OSDependent
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
include_directories(. ../../../OGLCompilersDLL)
|
||||
|
||||
set(SOURCES ossource.cpp osinclude.h)
|
||||
|
||||
add_library(OSDependent STATIC ${SOURCES})
|
||||
|
||||
if(WIN32)
|
||||
source_group("Source" FILES ${SOURCES})
|
||||
endif(WIN32)
|
||||
|
||||
install(TARGETS OSDependent
|
||||
ARCHIVE DESTINATION lib)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
include_directories(. ../../../OGLCompilersDLL)
|
||||
|
||||
set(SOURCES ossource.cpp osinclude.h)
|
||||
|
||||
add_library(OSDependent STATIC ${SOURCES})
|
||||
|
||||
if(WIN32)
|
||||
source_group("Source" FILES ${SOURCES})
|
||||
endif(WIN32)
|
||||
|
||||
install(TARGETS OSDependent
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user