mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Externals: Update glslang.
This updates glslang to commit 9bb8cfffb0eed010e07132282c41d73064a7a609 which is the current version listed in the known_good.json file for the version 1.3.212 of the Vulkan-ValidationLayers repo.
This commit is contained in:
34
Externals/glslang/SPIRV/SPVRemapper.cpp
vendored
34
Externals/glslang/SPIRV/SPVRemapper.cpp
vendored
@ -297,15 +297,21 @@ namespace spv {
|
||||
std::string spirvbin_t::literalString(unsigned word) const
|
||||
{
|
||||
std::string literal;
|
||||
const spirword_t * pos = spv.data() + word;
|
||||
|
||||
literal.reserve(16);
|
||||
|
||||
const char* bytes = reinterpret_cast<const char*>(spv.data() + word);
|
||||
|
||||
while (bytes && *bytes)
|
||||
literal += *bytes++;
|
||||
|
||||
return literal;
|
||||
do {
|
||||
spirword_t word = *pos;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
char c = word & 0xff;
|
||||
if (c == '\0')
|
||||
return literal;
|
||||
literal += c;
|
||||
word >>= 8;
|
||||
}
|
||||
pos++;
|
||||
} while (true);
|
||||
}
|
||||
|
||||
void spirvbin_t::applyMap()
|
||||
@ -544,6 +550,9 @@ namespace spv {
|
||||
// Extended instructions: currently, assume everything is an ID.
|
||||
// TODO: add whatever data we need for exceptions to that
|
||||
if (opCode == spv::OpExtInst) {
|
||||
|
||||
idFn(asId(word)); // Instruction set is an ID that also needs to be mapped
|
||||
|
||||
word += 2; // instruction set, and instruction from set
|
||||
numOperands -= 2;
|
||||
|
||||
@ -625,6 +634,9 @@ namespace spv {
|
||||
break;
|
||||
}
|
||||
|
||||
case spv::OperandVariableLiteralStrings:
|
||||
return nextInst;
|
||||
|
||||
// Execution mode might have extra literal operands. Skip them.
|
||||
case spv::OperandExecutionMode:
|
||||
return nextInst;
|
||||
@ -827,7 +839,15 @@ namespace spv {
|
||||
[&](spv::Id& id) {
|
||||
if (thisOpCode != spv::OpNop) {
|
||||
++idCounter;
|
||||
const std::uint32_t hashval = opCounter[thisOpCode] * thisOpCode * 50047 + idCounter + fnId * 117;
|
||||
const std::uint32_t hashval =
|
||||
// Explicitly cast operands to unsigned int to avoid integer
|
||||
// promotion to signed int followed by integer overflow,
|
||||
// which would result in undefined behavior.
|
||||
static_cast<unsigned int>(opCounter[thisOpCode])
|
||||
* thisOpCode
|
||||
* 50047
|
||||
+ idCounter
|
||||
+ static_cast<unsigned int>(fnId) * 117;
|
||||
|
||||
if (isOldIdUnmapped(id))
|
||||
localId(id, nextUnusedId(hashval % softTypeIdLimit + firstMappedID));
|
||||
|
Reference in New Issue
Block a user