(glslang) Compatibility tweaks for MSVC 2010 compatibility

This commit is contained in:
twinaphex 2018-02-04 15:49:53 +01:00
parent 24306429bd
commit 8771171f63
5 changed files with 14 additions and 5 deletions

View File

@ -363,7 +363,7 @@ bool glslang::compile_spirv(const string &source, Stage stage, std::vector<uint3
messages, &msg, forbid_include)) messages, &msg, forbid_include))
{ {
fprintf(stderr, "%s\n", msg.c_str()); fprintf(stderr, "%s\n", msg.c_str());
return {}; return false;
} }
if (!shader.parse(&process.GetResources(), 100, false, messages)) if (!shader.parse(&process.GetResources(), 100, false, messages))

View File

@ -887,8 +887,8 @@ void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable)
const TType& type = variable.getType(); const TType& type = variable.getType();
// emplace gives back a pair whose .first is an iterator to the item... // emplace gives back a pair whose .first is an iterator to the item...
auto entry = flattenMap.emplace(variable.getUniqueId(), auto entry = flattenMap.emplace(std::pair<int, TFlattenData>(variable.getUniqueId(),
TFlattenData(type.getQualifier().layoutBinding)); TFlattenData(type.getQualifier().layoutBinding)));
// ... and the item is a map pair, so first->second is the TFlattenData itself. // ... and the item is a map pair, so first->second is the TFlattenData itself.
flatten(loc, variable, type, entry.first->second, ""); flatten(loc, variable, type, entry.first->second, "");

View File

@ -1290,8 +1290,9 @@ static bool vulkan_alive(void *data)
static bool vulkan_suppress_screensaver(void *data, bool enable) static bool vulkan_suppress_screensaver(void *data, bool enable)
{ {
(void)data;
bool enabled = enable; bool enabled = enable;
(void)data;
return video_context_driver_suppress_screensaver(&enabled); return video_context_driver_suppress_screensaver(&enabled);
} }

View File

@ -88,7 +88,12 @@ struct glslang_meta
{ {
std::vector<glslang_parameter> parameters; std::vector<glslang_parameter> parameters;
std::string name; std::string name;
glslang_format rt_format = SLANG_FORMAT_UNKNOWN; glslang_format rt_format;
glslang_meta()
{
rt_format = SLANG_FORMAT_UNKNOWN;
}
}; };
struct glslang_output struct glslang_output

View File

@ -2,6 +2,9 @@
#ifdef WANT_GLSLANG #ifdef WANT_GLSLANG
#ifdef _MSC_VER #ifdef _MSC_VER
#include <compat/msvc.h> #include <compat/msvc.h>
#ifdef strtoull
#undef strtoull
#endif
#endif #endif
#include "../deps/glslang/glslang.cpp" #include "../deps/glslang/glslang.cpp"