Skip to content

Commit

Permalink
Bump 1.9.1 [release 1.9.1]
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Aug 21, 2023
1 parent b2114c4 commit 3d40a38
Show file tree
Hide file tree
Showing 24 changed files with 2,179 additions and 1,763 deletions.
18 changes: 18 additions & 0 deletions 3rdparty/glslang/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## 12.3.1 2023-07-20

### Other changes
* Improve backward compatibility for glslangValidator rename on Windows

## 12.3.0 2023-07-19

### Other changes
* Rename glslangValidator to glslang and create glslangValidator symlink
* Support HLSL binary literals
* Add missing initialization members for web
* Improve push_constant upgrading
* Fix race condition in spirv remap
* Support pre and post HLSL qualifier validation
* Force generateDebugInfo when non-semantic debug info is enabled
* Exit with error if output file cannot be written
* Fix struct member buffer reference decorations

## 12.2.0 2023-05-17

### Other changes
Expand Down
15 changes: 8 additions & 7 deletions 3rdparty/glslang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if(NOT ${SKIP_GLSLANG_INSTALL})
endif()
option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)

option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
option(ENABLE_GLSLANG_BINARIES "Builds glslang and spirv-remap" ON)

option(ENABLE_GLSLANG_JS
"If using Emscripten, build glslang.js. Otherwise, builds a sample executable for binary-size testing." OFF)
Expand Down Expand Up @@ -126,7 +126,7 @@ if(WIN32)
include(ChooseMSVCCRT.cmake)
endif()
add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
elseif(UNIX)
elseif(UNIX OR ANDROID)
add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
else()
message("unknown platform")
Expand Down Expand Up @@ -159,8 +159,8 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
add_compile_options(-fno-exceptions)
endif()

if(NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
# Error if there's symbols that are not found at link time.
if(NOT (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Emscripten"))
# Error if there's symbols that are not found at link time. Some linkers do not support this flag.
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_link_options("-Wl,-undefined,error")
elseif(NOT APPLE)
Expand Down Expand Up @@ -204,7 +204,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
function(glslang_set_link_args TARGET)
# For MinGW compiles, statically link against the GCC and C++ runtimes.
# This avoids the need to ship those runtimes as DLLs.
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
# This is supported by GCC and Clang.
if(WIN32 AND NOT MSVC)
set_target_properties(${TARGET} PROPERTIES
LINK_FLAGS "-static -static-libgcc -static-libstdc++")
endif()
Expand Down Expand Up @@ -319,11 +320,11 @@ if(ENABLE_CTEST AND BUILD_TESTING)

if (CMAKE_CONFIGURATION_TYPES)
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/localResults)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/glslangValidator)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/glslang)
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/spirv-remap)
else()
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslang)
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
endif()

Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/glslang/README-spirv-remap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ BUILD DEPENDENCIES:

BUILDING
--------------------------------------------------------------------------------
The standalone remapper is built along side glslangValidator through its
The standalone remapper is built along side glslang through its
normal build process.


Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/glslang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ An API for getting reflection information from the AST, reflection types/variabl

### Standalone Wrapper

`glslangValidator` is command-line tool for accessing the functionality above.
`glslang` is command-line tool for accessing the functionality above.

Status: Complete.

Expand All @@ -65,7 +65,7 @@ The above page, while not kept up to date, includes additional information regar

## Execution of Standalone Wrapper

To use the standalone binary form, execute `glslangValidator`, and it will print
To use the standalone binary form, execute `glslang`, and it will print
a usage statement. Basic operation is to give it a file containing a shader,
and it will print out warnings/errors and optionally an AST.

Expand Down
3,056 changes: 1,528 additions & 1,528 deletions 3rdparty/glslang/SPIRV/doc.cpp

Large diffs are not rendered by default.

43 changes: 29 additions & 14 deletions 3rdparty/glslang/StandAlone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ add_custom_command(
DEPENDS ${GLSLANG_INTRINSIC_PY}
COMMENT "Generating ${GLSLANG_INTRINSIC_H}")

#add_custom_target(glslangValidator DEPENDS ${GLSLANG_INTRINSIC_H})

set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H})

add_executable(glslangValidator ${SOURCES})
set_property(TARGET glslangValidator PROPERTY FOLDER tools)
glslang_set_link_args(glslangValidator)
add_executable(glslang-standalone ${SOURCES})
set_property(TARGET glslang-standalone PROPERTY FOLDER tools)
set_property(TARGET glslang-standalone PROPERTY OUTPUT_NAME glslang)
glslang_set_link_args(glslang-standalone)

set(LIBRARIES
glslang
Expand All @@ -70,13 +69,13 @@ elseif(UNIX)
endif()
endif()

target_link_libraries(glslangValidator ${LIBRARIES})
target_include_directories(glslangValidator PUBLIC
target_link_libraries(glslang-standalone ${LIBRARIES})
target_include_directories(glslang-standalone PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)

if(ENABLE_OPT)
target_include_directories(glslangValidator
target_include_directories(glslang-standalone
PRIVATE ${spirv-tools_SOURCE_DIR}/include
)
endif()
Expand All @@ -94,19 +93,35 @@ if(WIN32)
endif()

if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslangValidator EXPORT glslang-targets)
install(TARGETS glslang-standalone EXPORT glslang-targets)

# Backward compatibility
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslangValidatorTargets.cmake" "
message(WARNING \"Using `glslangValidatorTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-standaloneTargets.cmake" "
message(WARNING \"Using `glslang-standaloneTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::glslangValidator)
if (NOT TARGET glslang::glslang-standalone)
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(glslangValidator ALIAS glslang::glslangValidator)
add_library(glslang-standalone ALIAS glslang::glslang-standalone)
")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslangValidatorTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslang-standaloneTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)

# Create a symbolic link to glslang named glslangValidator for backwards compatibility
set(legacy_glslang_name "glslangValidator${CMAKE_EXECUTABLE_SUFFIX}")
set(link_method create_symlink)
if (WIN32 OR MINGW)
set(link_method copy_if_different)
endif()
add_custom_command(TARGET glslang-standalone
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E ${link_method} $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name}
WORKING_DIRECTORY $<TARGET_FILE_DIR:glslang-standalone>)

# Create the same symlink at install time
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E ${link_method} $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name} \
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")

if(ENABLE_SPVREMAPPER)
install(TARGETS spirv-remap EXPORT glslang-targets)
Expand Down
5 changes: 2 additions & 3 deletions 3rdparty/glslang/StandAlone/StandAlone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ void CompileFile(const char* fileName, ShHandle compiler)
//
void usage()
{
printf("Usage: glslangValidator [option]... [file]...\n"
printf("Usage: glslang [option]... [file]...\n"
"\n"
"'file' can end in .<stage> for auto-stage classification, where <stage> is:\n"
" .conf to provide a config file that replaces the default configuration\n"
Expand Down Expand Up @@ -2089,8 +2089,7 @@ void usage()
" --variable-name <name>\n"
" --vn <name> creates a C header file that contains a\n"
" uint32_t array named <name>\n"
" initialized with the shader binary code\n"
);
" initialized with the shader binary code\n");

exit(EFailUsage);
}
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/glslang/glslang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

if(WIN32)
add_subdirectory(OSDependent/Windows)
elseif(UNIX OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
elseif(UNIX OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia" OR ANDROID)
add_subdirectory(OSDependent/Unix)
else()
message("unknown platform")
Expand Down
33 changes: 19 additions & 14 deletions 3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ class TVarSetTraverser : public TLiveTraverser
base->getWritableType().getQualifier().layoutComponent = at->second.newComponent;
if (at->second.newIndex != -1)
base->getWritableType().getQualifier().layoutIndex = at->second.newIndex;
if (at->second.upgradedToPushConstant)
base->getWritableType().getQualifier().layoutPushConstant = true;
}

private:
Expand Down Expand Up @@ -1670,31 +1672,34 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
}
}
}
// If it's been upgraded to push_constant, then remove it from the uniformVector
// If it's been upgraded to push_constant, then set the flag so when its traversed
// in the next for loop, all references to this symbol will get their flag changed.
// so it doesn't get a set/binding assigned to it.
if (upgraded) {
while (1) {
auto at = std::find_if(uniformVector.begin(), uniformVector.end(),
[this](const TVarLivePair& p) { return p.first == autoPushConstantBlockName; });
if (at != uniformVector.end())
uniformVector.erase(at);
else
break;
}
std::for_each(uniformVector.begin(), uniformVector.end(),
[this](TVarLivePair& p) {
if (p.first == autoPushConstantBlockName) {
p.second.upgradedToPushConstant = true;
}
});
}
}
for (size_t stage = 0; stage < EShLangCount; stage++) {
if (intermediates[stage] != nullptr) {
// traverse each stage, set new location to each input/output and unifom symbol, set new binding to
// ubo, ssbo and opaque symbols
// ubo, ssbo and opaque symbols. Assign push_constant upgrades as well.
TVarLiveMap** pUniformVarMap = uniformResolve.uniformVarMap;
std::for_each(uniformVector.begin(), uniformVector.end(), [pUniformVarMap, stage](TVarLivePair p) {
auto at = pUniformVarMap[stage]->find(p.second.symbol->getAccessName());
if (at != pUniformVarMap[stage]->end() && at->second.id == p.second.id){
int resolvedBinding = at->second.newBinding;
at->second = p.second;
if (resolvedBinding > 0)
at->second.newBinding = resolvedBinding;
if (p.second.upgradedToPushConstant) {
at->second.upgradedToPushConstant = true;
} else {
int resolvedBinding = at->second.newBinding;
at->second = p.second;
if (resolvedBinding > 0)
at->second.newBinding = resolvedBinding;
}
}
});
TVarSetTraverser iter_iomap(*intermediates[stage], *inVarMaps[stage], *outVarMaps[stage],
Expand Down
2 changes: 2 additions & 0 deletions 3rdparty/glslang/glslang/MachineIndependent/iomapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct TVarEntryInfo {
long long id;
TIntermSymbol* symbol;
bool live;
bool upgradedToPushConstant;
int newBinding;
int newSet;
int newLocation;
Expand All @@ -63,6 +64,7 @@ struct TVarEntryInfo {
EShLanguage stage;

void clearNewAssignments() {
upgradedToPushConstant = false;
newBinding = -1;
newSet = -1;
newLocation = -1;
Expand Down
66 changes: 33 additions & 33 deletions 3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,6 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
typeCollision = false;

int set;
int setRT;
if (qualifier.isPipeInput())
set = 0;
else if (qualifier.isPipeOutput())
Expand All @@ -1645,11 +1644,11 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
else if (qualifier.storage == EvqTileImageEXT)
set = 4;
else if (qualifier.isAnyPayload())
setRT = 0;
set = 0;
else if (qualifier.isAnyCallable())
setRT = 1;
set = 1;
else if (qualifier.isHitObjectAttrNV())
setRT = 2;
set = 2;
else
return -1;

Expand Down Expand Up @@ -1691,10 +1690,12 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
#ifndef GLSLANG_WEB
if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) {
TRange range(qualifier.layoutLocation, qualifier.layoutLocation);
collision = checkLocationRT(setRT, qualifier.layoutLocation);
collision = checkLocationRT(set, qualifier.layoutLocation);
if (collision < 0)
usedIoRT[setRT].push_back(range);
} else if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
usedIoRT[set].push_back(range);
return collision;
}
if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
(qualifier.isPipeInput() || qualifier.isPipeOutput())) {
// Dealing with dvec3 in/out split across two locations.
// Need two io-ranges.
Expand All @@ -1720,34 +1721,33 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
if (collision < 0)
usedIo[set].push_back(range2);
}
} else
return collision;
}
#endif
{
// Not a dvec3 in/out split across two locations, generic path.
// Need a single IO-range block.

TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1);
TRange componentRange(0, 3);
if (qualifier.hasComponent() || type.getVectorSize() > 0) {
int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1);
if (qualifier.hasComponent())
componentRange.start = qualifier.layoutComponent;
componentRange.last = componentRange.start + consumedComponents - 1;
}

// combine location and component ranges
TBasicType basicTy = type.getBasicType();
if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT())
basicTy = type.getSampler().type;
TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0);

// check for collisions, except for vertex inputs on desktop targeting OpenGL
if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
collision = checkLocationRange(set, range, type, typeCollision);
// Not a dvec3 in/out split across two locations, generic path.
// Need a single IO-range block.

TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1);
TRange componentRange(0, 3);
if (qualifier.hasComponent() || type.getVectorSize() > 0) {
int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1);
if (qualifier.hasComponent())
componentRange.start = qualifier.layoutComponent;
componentRange.last = componentRange.start + consumedComponents - 1;
}

// combine location and component ranges
TBasicType basicTy = type.getBasicType();
if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT())
basicTy = type.getSampler().type;
TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0);

// check for collisions, except for vertex inputs on desktop targeting OpenGL
if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
collision = checkLocationRange(set, range, type, typeCollision);

if (collision < 0)
usedIo[set].push_back(range);
}
if (collision < 0)
usedIo[set].push_back(range);

return collision;
}
Expand Down
Loading

0 comments on commit 3d40a38

Please sign in to comment.