SPV: Implement new extensions GL_KHX_device_group and GL_KHX_multiview.

These correspond to SPV_KHR_device_group and SPV_KHR_multiview.
Also, bring tests up to date with Khronos internals, and some misc. related changes.
This commit is contained in:
John Kessenich
2017-02-27 01:20:51 -07:00
parent 4a57dced66
commit 6c8aaacd28
18 changed files with 252 additions and 26 deletions

View File

@@ -203,6 +203,9 @@ enum TBuiltInVariable {
EbvBaryCoordPullModel,
#endif
EbvViewIndex,
EbvDeviceIndex,
#ifdef NV_EXTENSIONS
EbvViewportMaskNV,
EbvSecondaryPositionNV,
@@ -210,6 +213,7 @@ enum TBuiltInVariable {
EbvPositionPerViewNV,
EbvViewportMaskPerViewNV,
#endif
// HLSL built-ins that live only temporarily, until they get remapped
// to one of the above.
EbvFragDepthGreater,

View File

@@ -188,6 +188,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
case EbtFloat: break;
case EbtInt: s.append("i"); break;
case EbtUint: s.append("u"); break;
case EbtInt64: s.append("i64"); break;
case EbtUint64: s.append("u64"); break;
default: break; // some compilers want this
}
if (image) {

View File

@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.1845"
#define GLSLANG_DATE "24-Feb-2017"
#define GLSLANG_REVISION "Overload400-PrecQual.1853"
#define GLSLANG_DATE "27-Feb-2017"

View File

@@ -85,6 +85,8 @@ TBuiltIns::TBuiltIns()
prefixes[EbtFloat] = "";
prefixes[EbtInt] = "i";
prefixes[EbtUint] = "u";
prefixes[EbtInt64] = "i64";
prefixes[EbtUint64] = "u64";
postfixes[2] = "2";
postfixes[3] = "3";
postfixes[4] = "4";
@@ -103,6 +105,7 @@ TBuiltIns::~TBuiltIns()
{
}
//
// Add all context-independent built-in functions and variables that are present
// for the given version and profile. Share common ones across stages, otherwise
@@ -3698,6 +3701,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
if (profile != EEsProfile) {
commonBuiltins.append("uniform int gl_ViewIndexKHR;");
commonBuiltins.append("uniform int gl_DeviceIndexKHR;"); // GL_KHX_device_group
}
// printf("%s\n", commonBuiltins.c_str());
// printf("%s\n", stageBuiltins[EShLangFragment].c_str());
}
@@ -5308,6 +5316,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("imageAtomicExchange", 1, &E_GL_OES_shader_image_atomic);
symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic);
}
if (profile != EEsProfile) {
symbolTable.setFunctionExtensions("gl_DeviceIndexKHR", 1, &E_GL_KHX_device_group);
BuiltInVariable("gl_DeviceIndexKHR", EbvDeviceIndex, symbolTable);
symbolTable.setFunctionExtensions("gl_ViewIndexKHR", 1, &E_GL_KHX_multiview);
BuiltInVariable("gl_ViewIndexKHR", EbvViewIndex, symbolTable);
}
break;
case EShLangCompute:

View File

@@ -232,6 +232,10 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_OES_tessellation_point_size] = EBhDisable;
extensionBehavior[E_GL_OES_texture_buffer] = EBhDisable;
extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisable;
// KHX extensions
extensionBehavior[E_GL_KHX_device_group] = EBhDisable;
extensionBehavior[E_GL_KHX_multiview] = EBhDisable;
}
// Get code that is not part of a shared symbol table, is specific to this shader,

View File

@@ -132,6 +132,10 @@ const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture
const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers";
const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted";
// KHX extensions
const char* const E_GL_KHX_device_group = "GL_KHX_device_group";
const char* const E_GL_KHX_multiview = "GL_KHX_multiview";
// #line and #include
const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive";
const char* const E_GL_GOOGLE_include_directive = "GL_GOOGLE_include_directive";