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

@ -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";