shaderc: Allow passing CS buffers into all shader stages in GLSL.

This commit is contained in:
Branimir Karadžić
2018-01-15 17:39:18 -08:00
parent bed461b3c5
commit cf91b62542
2 changed files with 19 additions and 1 deletions

View File

@@ -76,7 +76,6 @@ function bgfxProjectBase(_kind, _defines)
includedirs {
path.join(BGFX_DIR, "3rdparty"),
path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
}
@@ -121,6 +120,11 @@ function bgfxProjectBase(_kind, _defines)
"BGFX_CONFIG_DEBUG=1",
}
configuration { "vs*", "not durango" }
includedirs {
path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
}
configuration { "android*" }
links {
"EGL",

View File

@@ -1792,6 +1792,11 @@ namespace bgfx
{
std::string code;
if (NULL != bx::strFind(preprocessor.m_preprocessed.c_str(), "layout(std430") )
{
glsl = 430;
}
if (glsl < 400)
{
const bool usesTextureLod = false
@@ -2004,6 +2009,15 @@ namespace bgfx
else
{
bx::stringPrintf(code, "#version %d\n", glsl);
bx::stringPrintf(code
, "#define texture2DLod textureLod\n"
"#define texture2DGrad textureGrad\n"
"#define texture2DProjLod textureProjLod\n"
"#define texture2DProjGrad textureProjGrad\n"
"#define textureCubeLod textureLod\n"
"#define textureCubeGrad textureGrad\n"
);
}
code += preprocessor.m_preprocessed;